|
|
@@ -1,6 +1,7 @@
|
|
|
package com.kede.wechat.service.impl;
|
|
|
|
|
|
import com.kede.common.dao.ChatMsgMapper;
|
|
|
+import com.kede.common.enums.WechatSmgTypeEnum;
|
|
|
import com.kede.common.model.ChatMsg;
|
|
|
import com.kede.common.model.ChatMsgUser;
|
|
|
import com.kede.common.utils.DateUtils;
|
|
|
@@ -179,6 +180,7 @@ public class ConversationContentServiceImpl extends BaseMybatisDao<ChatMsgUserMa
|
|
|
if (text!=null){
|
|
|
String content1 = text.getString("content");
|
|
|
chatMsg.setContent(pushCharset(content1));
|
|
|
+// chatMsg.setContent(content1);
|
|
|
}
|
|
|
}else if (msgtype.equals("link"))
|
|
|
{
|
|
|
@@ -595,15 +597,25 @@ public class ConversationContentServiceImpl extends BaseMybatisDao<ChatMsgUserMa
|
|
|
|
|
|
@Override
|
|
|
public Object getMsgList(InputgetUserMsg in) {
|
|
|
+ List<ChatMsg> chatMsgs=new ArrayList<>();
|
|
|
if (StringUtils.isNotEmpty(in.getRoomId())){
|
|
|
- return chatMsgMapper.selectByRoomId(in.getRoomId());
|
|
|
+ chatMsgs = chatMsgMapper.selectByRoomId(in);
|
|
|
}else if (StringUtils.isNotEmpty(in.getUserId())&&StringUtils.isNotEmpty(in.getFoId())){
|
|
|
- List<ChatMsg> chatMsgs = chatMsgMapper.selectByUserIdAndFoId(in.getUserId(), in.getFoId());
|
|
|
+ chatMsgs = chatMsgMapper.selectByUserIdAndFoId(in);
|
|
|
//将list按时间先后排序
|
|
|
chatMsgs.sort(Comparator.comparing(ChatMsg::getMsgtime));
|
|
|
- return chatMsgs;
|
|
|
+
|
|
|
}
|
|
|
- return null;
|
|
|
+ for (ChatMsg e : chatMsgs) {
|
|
|
+ WechatSmgTypeEnum field = WechatSmgTypeEnum.getField(e.getMsgtype());
|
|
|
+ if (field==null){
|
|
|
+ e.setMsgType(e.getMsgtype());
|
|
|
+ }else {
|
|
|
+ String desc = field.getDesc();
|
|
|
+ e.setMsgType(desc);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return chatMsgs;
|
|
|
}
|
|
|
|
|
|
|