|
|
@@ -2,6 +2,7 @@ package com.nb.im.ws;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
@@ -66,7 +67,16 @@ public class PubMsgRequestHandler implements IMsgRequestHandler {
|
|
|
.allMatch(filter -> filter.doFilter(channelContext, message));
|
|
|
if(result){
|
|
|
try {
|
|
|
- PubMsgInfo pubMsgInfo = objectMapper.readerFor(PubMsgInfo.class).readValue(String.valueOf(message.getPayload()));
|
|
|
+ PubMsgInfo pubMsgInfo=null;
|
|
|
+ String key=null;
|
|
|
+ if (message.getPayload() instanceof JSONObject) {
|
|
|
+ JSONObject obj= (JSONObject) message.getPayload();
|
|
|
+ key=obj.getStr("key");
|
|
|
+ }else {
|
|
|
+ key=JSONUtil.parseObj(message.getPayload()).getStr("key");
|
|
|
+ }
|
|
|
+ pubMsgInfo= objectMapper.readerFor(PubMsgInfo.class).readValue(String.valueOf(message.getPayload()));
|
|
|
+ pubMsgInfo.setKey(key);
|
|
|
pubMsgInfo.setOperationType(MsgEnum.NORMAL);
|
|
|
imUtils.send(param,topicWrapper,pubMsgInfo,channelContext,false);
|
|
|
}catch (Exception e){
|