线程池-云信发批量房间消息转移到async线程池

This commit is contained in:
khalil
2025-05-06 17:32:23 +08:00
parent c70a2d4ce1
commit de0e767d41
48 changed files with 319 additions and 1292 deletions

View File

@@ -92,7 +92,9 @@
</select>
<select id="listValidRoomsByPartitionId" resultMap="RoomResultMap">
select * from room where uid &lt;&gt; #{roomUid} and partition_id = #{partitionId} and valid = 1 and online_num > 0 order by online_num desc
select * from room where 1=1
<if test="null != roomUid" > and uid &lt;&gt; #{roomUid} </if>
and partition_id = #{partitionId} and valid = 1 and online_num > 0 order by online_num desc
</select>
</mapper>

View File

@@ -1,44 +1,23 @@
package com.accompany.common.constant;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Created by liuguofu on 2017/6/6.
*/
@NoArgsConstructor
@Data
public class Attach {
private int first;
private int second;
private String message;
private Object data;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getData() {
return data;
}
public void setData(Object data) {
public Attach(int first, int second, Object data) {
this.first = first;
this.second = second;
this.data = data;
}
public int getFirst() {
return first;
}
public void setFirst(int first) {
this.first = first;
}
public int getSecond() {
return second;
}
public void setSecond(int second) {
this.second = second;
}
}

View File

@@ -39,8 +39,11 @@ public class BaseChatRoomMsg {
attach.setSecond(second);
attach.setData(JSON.toJSONString(data));
return buildBaseChatRoomMsg(attach);
}
public static BaseChatRoomMsg buildBaseChatRoomMsg(Attach attach){
BaseChatRoomMsg msg = new BaseChatRoomMsg();
msg.setMsgId(UUIDUtil.get());
msg.setMsgType(Constant.DefineProtocol.CUSTOM_MESS_DEFINE);
msg.setSubType(1);
msg.setAttach(JSON.toJSONString(attach));