09-17-优化
This commit is contained in:
@ -485,10 +485,7 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket
|
||||
chatHistory = new ChatHistory();
|
||||
//发送方设置为99 表示系统消息
|
||||
chatHistory.setSenderId(99L);
|
||||
chatHistory.setMessage(jsonObject.toString());
|
||||
chatHistory.setMessageDate(new Date());
|
||||
chatHistory.setIsRead("1");//未读
|
||||
|
||||
jsonObject.put("nickName","系统消息");
|
||||
}
|
||||
|
||||
//2:考勤消息
|
||||
@ -509,9 +506,6 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket
|
||||
chatHistory = new ChatHistory();
|
||||
//发送方设置为100 表示系统消息中的考勤消息
|
||||
chatHistory.setSenderId(100L);
|
||||
chatHistory.setMessage(jsonObject.toString());
|
||||
chatHistory.setMessageDate(new Date());
|
||||
chatHistory.setIsRead("1");//未读
|
||||
jsonObject.put("nickName","考勤消息");
|
||||
}
|
||||
|
||||
@ -533,9 +527,6 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket
|
||||
chatHistory = new ChatHistory();
|
||||
//发送方设置为101 表示系统消息中的安全消息
|
||||
chatHistory.setSenderId(101L);
|
||||
chatHistory.setMessage(jsonObject.toString());
|
||||
chatHistory.setMessageDate(new Date());
|
||||
chatHistory.setIsRead("1");//未读
|
||||
jsonObject.put("nickName","安全消息");
|
||||
}
|
||||
|
||||
@ -557,21 +548,23 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket
|
||||
chatHistory = new ChatHistory();
|
||||
//发送方设置为102 表示系统消息中的质量消息
|
||||
chatHistory.setSenderId(102L);
|
||||
chatHistory.setMessage(jsonObject.toString());
|
||||
chatHistory.setMessageDate(new Date());
|
||||
chatHistory.setIsRead("1");//未读
|
||||
jsonObject.put("nickName","质量消息");
|
||||
}
|
||||
|
||||
default -> {
|
||||
throw new RuntimeException("未知的类型");
|
||||
log.error("未知消息类型");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
chatGroupService.saveOrUpdate(groupServiceOne);
|
||||
jsonObject.put("roomId", groupServiceOne.getId());
|
||||
chatHistory.setMessageType(jsonObject.get("messageType").toString());
|
||||
|
||||
chatHistory.setMessage(jsonObject.toString());
|
||||
chatHistory.setMessageType("txt");
|
||||
chatHistory.setMessageDate(new Date());
|
||||
chatHistory.setGeterId(groupServiceOne.getId());
|
||||
chatHistory.setIsRead("1");//未读
|
||||
chatHistoryService.save(chatHistory);
|
||||
|
||||
//发送消息后 将该房间未读消息数加1
|
||||
|
||||
Reference in New Issue
Block a user