线程池-云信发批量房间消息转移到async线程池
This commit is contained in:
@@ -92,7 +92,9 @@
|
||||
</select>
|
||||
|
||||
<select id="listValidRoomsByPartitionId" resultMap="RoomResultMap">
|
||||
select * from room where uid <> #{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 <> #{roomUid} </if>
|
||||
and partition_id = #{partitionId} and valid = 1 and online_num > 0 order by online_num desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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));
|
||||
|
Reference in New Issue
Block a user