4 Commits

11 changed files with 113 additions and 64 deletions

View File

@@ -334,6 +334,15 @@ public class MyApiController {
return BusiResult.success();
}
@RequestMapping("/createPublicRoom")
@ResponseBody
public BusiResult<Void> createPublicRoom(Long roomId, Integer partitionId) {
if (null == roomId || !roomId.equals(603L) || null == partitionId) {
throw new AdminServiceException(BusiStatus.PARAMERROR);
}
myApiService.createPublicRoom(partitionId);
return BusiResult.success();
}
@Autowired
private GoogleTokenVerifier googleTokenVerifier;

View File

@@ -3,9 +3,9 @@ spring:
dynamic-datasource:
master:
poolName: master
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
@@ -15,9 +15,9 @@ spring:
max-lifetime: 7000
slave:
poolName: slave
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
@@ -26,20 +26,20 @@ spring:
connection-test-query: select 1
max-lifetime: 7000
redis:
host: 124.156.164.187
host: 129.226.62.202
port: 6200
maxTotal: 100
maxIdle: 50
maxWait: 2500
testOnBorrow: true
testOnReturn: true
password: anan@dev@redis@#!
password: pc8DphhaXwTe2jyv
redisson:
# file: classpath:redisson.yaml
config: |
singleServerConfig:
address: redis://124.156.164.187:6200
password: anan@dev@redis@#!
address: redis://129.226.62.202:6200
password: pc8DphhaXwTe2jyv
connectionMinimumIdleSize: 4
timeout: 10000
threads: 8
@@ -47,17 +47,9 @@ spring:
codec: !<org.redisson.codec.JsonJacksonCodec> {}
transportMode: "NIO"
##activemq 配置
activemq:
brokerUrl: tcp://124.156.164.187:61619
user: system
password: manager
maxConnections: 50
idleTimeout: 30000
## rocketmq 配置
rocketmq:
name-server: 124.156.164.187:9876
name-server: 129.226.62.202:9876
producer:
group: peko-group
group: eparty-group
sendMessageTimeout: 300000

View File

@@ -19,7 +19,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml
@@ -42,7 +42,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml

View File

@@ -15,9 +15,20 @@ public class Attach {
private String message;
private Object data;
//用于携带给客户端用于区分同一组first和second的消息是单房间消息还是轮询全服房间遍历发送的单房间消息
//已使用公聊房机制解决轮询全服房间发送消息的云信im限频问题
private Integer allRoomMsg;
public Attach(int first, int second, Object data) {
this.first = first;
this.second = second;
this.data = data;
}
public Attach(int first, int second, Object data, int allRoomMsg) {
this.first = first;
this.second = second;
this.data = data;
this.allRoomMsg = allRoomMsg;
}
}

View File

@@ -18,10 +18,12 @@ import com.accompany.common.utils.ReplaceAppDomainUtils;
import com.accompany.common.utils.UUIDUtil;
import com.accompany.core.base.SpringContextHolder;
import com.accompany.core.enumeration.I18nAlertEnum;
import com.accompany.core.model.PartitionInfo;
import com.accompany.core.model.Room;
import com.accompany.core.model.Users;
import com.accompany.core.mybatismapper.RoomMapperExpand;
import com.accompany.core.service.base.BaseService;
import com.accompany.core.service.partition.PartitionInfoService;
import com.accompany.core.util.I18NMessageSourceUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@@ -61,6 +63,8 @@ public class SendSysMsgService extends BaseService {
@Autowired
private RoomMapperExpand roomMapperExpand;
@Autowired
private PartitionInfoService partitionInfoService;
/**
* 发送系统通知,捕获异常不抛出。
@@ -546,13 +550,33 @@ public class SendSysMsgService extends BaseService {
});
}
public void sendMessageToPartition(Integer partitionId, int first, int second, Object data) {
public void sendSingleRoomMessage(long roomId, String fromAccId, BaseChatRoomMsg msg) {
try {
String msgId = UUIDUtil.get();
this.erBanNetEaseService.sendChatRoomMsg(roomId, msgId, fromAccId,
msg.getMsgType(), msg.getAttach(), msg.getExt());
} catch (Exception e) {
log.error("发送房间消息失败[roomId : {}, fromAccId : {}, message : {}]",
roomId, fromAccId, msg, e);
}
}
public void sendMessageToPartition(int partitionId, int first, int second, Object data) {
Attach attach = new Attach(first, second, data);
sendMessageToPartition(partitionId, attach);
}
public void sendMessageToPartition(Integer partitionId, Attach attach) {
public void sendMessageToPartition(int partitionId, Attach attach) {
attach.setAllRoomMsg(Constant.Yes1No0.YES);
BaseChatRoomMsg msg = BaseChatRoomMsg.buildBaseChatRoomMsg(attach);
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
if (partitionInfo == null){
return;
}
sendSingleRoomMessage(partitionInfo.getPublicChatRoomId(), SystemConfig.secretaryUid, attach);
sendMessageToPartition(partitionId, msg);
}
@@ -562,7 +586,16 @@ public class SendSysMsgService extends BaseService {
}
public void sendMessageToPartition(Room curRoom, Attach attach) {
attach.setAllRoomMsg(Constant.Yes1No0.YES);
BaseChatRoomMsg msg = BaseChatRoomMsg.buildBaseChatRoomMsg(attach);
PartitionInfo partitionInfo = partitionInfoService.getById(curRoom.getPartitionId());
if (partitionInfo == null){
return;
}
sendSingleRoomMessage(partitionInfo.getPublicChatRoomId(), SystemConfig.secretaryUid, attach);
sendMessageToPartition(curRoom, msg);
}
@@ -608,6 +641,15 @@ public class SendSysMsgService extends BaseService {
}
public void sendFloatingMessageForRoom(FloatingMessageTemplate message) {
int partitionId = message.getPartitionId();
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
if (partitionInfo == null){
return;
}
sendFloatingMessageForRoom(partitionInfo.getPublicChatRoomId(), Long.parseLong(SystemConfig.secretaryUid), message);
List<Room> validRooms = this.roomMapperExpand.listValidRoomsByPartitionId(null, message.getPartitionId());
if (CollectionUtils.isEmpty(validRooms)){
return;

View File

@@ -28,8 +28,7 @@
<if test="familyId != null">
and fm.family_id = #{familyId}
</if>
and fm.family_id = 11
and (fm.enable = 1 or (fm.update_time between '2025-10-01 00:00:00' and '2025-10-15 23:59:59'))
and (fm.enable = 1 or (fm.update_time between #{startTime} and #{endTime}))
group by family_id, uid
) fmm on fm.id = fmm.id
order by role_type asc , enable desc, create_time asc

View File

@@ -3,59 +3,55 @@ spring:
dynamic-datasource:
master:
poolName: master
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
minimum-idle: 4
maximum-pool-size: 16
minimum-idle: 10
maximum-pool-size: 20
connection-test-query: select 1
max-lifetime: 1800000 # 30分钟
validation-timeout: 6000 # 验证连接的最大等待时间
idle-timeout: 600000 # 空闲连接超时时间10分钟
max-lifetime: 7000
slave:
poolName: slave
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
minimum-idle: 4
maximum-pool-size: 32
minimum-idle: 10
maximum-pool-size: 20
connection-test-query: select 1
max-lifetime: 1800000 # 30分钟
validation-timeout: 6000 # 验证连接的最大等待时间
idle-timeout: 600000 # 空闲连接超时时间10分钟
max-lifetime: 7000
redis:
host: 124.156.164.187
host: 129.226.62.202
port: 6200
maxTotal: 24
maxIdle: 12
maxTotal: 100
maxIdle: 50
maxWait: 2500
testOnBorrow: true
testOnReturn: true
password: anan@dev@redis@#!
password: pc8DphhaXwTe2jyv
redisson:
# file: classpath:redisson.yaml
config: |
singleServerConfig:
address: redis://124.156.164.187:6200
password: anan@dev@redis@#!
address: redis://129.226.62.202:6200
password: pc8DphhaXwTe2jyv
connectionMinimumIdleSize: 4
timeout: 10000
threads: 2
nettyThreads: 4
threads: 8
nettyThreads: 16
codec: !<org.redisson.codec.JsonJacksonCodec> {}
transportMode: "NIO"
## rocketmq 配置
rocketmq:
name-server: 124.156.164.187:9876
name-server: 129.226.62.202:9876
producer:
group: peko-group
group: eparty-group
sendMessageTimeout: 300000
server:

View File

@@ -19,7 +19,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml
@@ -42,7 +42,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml

View File

@@ -3,9 +3,9 @@ spring:
dynamic-datasource:
master:
poolName: master
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
@@ -15,9 +15,9 @@ spring:
max-lifetime: 7000
slave:
poolName: slave
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
@@ -26,20 +26,20 @@ spring:
connection-test-query: select 1
max-lifetime: 7000
redis:
host: 124.156.164.187
host: 129.226.62.202
port: 6200
maxTotal: 100
maxIdle: 50
maxWait: 2500
testOnBorrow: true
testOnReturn: true
password: anan@dev@redis@#!
password: pc8DphhaXwTe2jyv
redisson:
# file: classpath:redisson.yaml
config: |
singleServerConfig:
address: redis://124.156.164.187:6200
password: anan@dev@redis@#!
address: redis://129.226.62.202:6200
password: pc8DphhaXwTe2jyv
connectionMinimumIdleSize: 4
timeout: 10000
threads: 8
@@ -49,9 +49,9 @@ spring:
## rocketmq 配置
rocketmq:
name-server: 124.156.164.187:9876
name-server: 129.226.62.202:9876
producer:
group: peko-group
group: eparty-group
sendMessageTimeout: 300000
server:

View File

@@ -19,7 +19,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml
@@ -42,7 +42,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml

View File

@@ -16,7 +16,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml
@@ -39,7 +39,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml