|
|
@@ -2,6 +2,8 @@ package com.nb.im.ws;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
@@ -75,9 +77,15 @@ public class PubMsgRequestHandler implements IMsgRequestHandler {
|
|
|
}else {
|
|
|
key=JSONUtil.parseObj(message.getPayload()).getStr("key");
|
|
|
}
|
|
|
+ if(StrUtil.isBlank(key)){
|
|
|
+ key=message.getKey();
|
|
|
+ }
|
|
|
pubMsgInfo= objectMapper.readerFor(PubMsgInfo.class).readValue(String.valueOf(message.getPayload()));
|
|
|
pubMsgInfo.setKey(key);
|
|
|
pubMsgInfo.setOperationType(MsgEnum.NORMAL);
|
|
|
+ if(ObjectUtil.isNull(pubMsgInfo.getSendTimestamp())){
|
|
|
+ pubMsgInfo.setSendTimestamp(System.currentTimeMillis());
|
|
|
+ }
|
|
|
imUtils.send(param,topicWrapper,pubMsgInfo,channelContext,false);
|
|
|
}catch (Exception e){
|
|
|
log.error("PubMsgRequestHandler.handler msg confront error,",e);
|