Commit 595bc14d by Future

content中type字段拆出

parent ee40a6e2
......@@ -325,8 +325,14 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImMessageOnlineSend imMessageOnlineSend = new ImMessageOnlineSend();
imMessageOnlineSend.setMsgId(messageId);
imMessageOnlineSend.setType(MsgTypeEnum.INVITE_CLIENT_JOIN_CONVERSATION.getUriCode());
imMessageOnlineSend.setSender(imClientSender.getClientId());
imMessageOnlineSend.setContent((HashMap) content);
Map<String, String> contentMap = new HashMap<>();
// 操作的client ID
contentMap.put("operator", imClientSender.getClientId());
// 被操作的client ID
contentMap.put("passivityOperator", client2.getClientId());
imMessageOnlineSend.setContent(contentMap);
imMessageOnlineSend.setConversationId(conversationMembers.getFkConversationId());
imMessageOnlineSend.setWithdraw(Boolean.FALSE);
imMessageOnlineSend.setEvent(Boolean.TRUE);
......@@ -448,8 +454,14 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImMessageOnlineSend imMessageOnlineSend = new ImMessageOnlineSend();
imMessageOnlineSend.setMsgId(messageId);
imMessageOnlineSend.setType(MsgTypeEnum.REMOVE_CLIENT_CONVERSATION.getUriCode());
imMessageOnlineSend.setSender(imClientSender.getClientId());
imMessageOnlineSend.setContent((HashMap) content);
Map<String, Object> contentMap = new HashMap<>();
// 操作的client ID
contentMap.put("operator", imClientSender.getClientId());
// 被操作的client ID
contentMap.put("passivityOperator", client2.getClientId());
imMessageOnlineSend.setContent(contentMap);
imMessageOnlineSend.setConversationId(conversationMembers.getFkConversationId());
imMessageOnlineSend.setWithdraw(Boolean.FALSE);
imMessageOnlineSend.setEvent(Boolean.TRUE);
......@@ -562,8 +574,8 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImMessageOnlineSend imMessageOnlineSend = new ImMessageOnlineSend();
imMessageOnlineSend.setMsgId(messageId);
imMessageOnlineSend.setType(MsgTypeEnum.LEAVE_CONVERSATION.getUriCode());
imMessageOnlineSend.setSender(imClientSender.getClientId());
imMessageOnlineSend.setContent((HashMap) content);
imMessageOnlineSend.setConversationId(conversationMembers.getFkConversationId());
imMessageOnlineSend.setWithdraw(Boolean.FALSE);
imMessageOnlineSend.setEvent(Boolean.TRUE);
......
......@@ -101,12 +101,10 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
ImApplication application = imApplicationService.getCacheById(curentClient.getFkAppid());
// 内容
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("type", MsgTypeEnum.CLIENT_RECEIVED_MSG.getUriCode() + "");
stringStringHashMap.put("receiverId", curentClient.getClientId());
HashMap<String, String> contentMap = new HashMap<>();
contentMap.put("receiverId", curentClient.getClientId());
// 推送给接收方
sendMsgStatus(curentClient, application, stringStringHashMap, imMsgReceivedUpdate.getMsgIds());
sendMsgStatus(curentClient, MsgTypeEnum.CLIENT_RECEIVED_MSG, contentMap, imMsgReceivedUpdate.getMsgIds());
// 是否同时修改为已读状态
if (imMsgReceivedUpdate.getReadStatus()) {
......@@ -144,10 +142,9 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
ImApplication application = imApplicationService.getCacheById(curentClient.getFkAppid());
// 内容
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("type", MsgTypeEnum.CLIENT_READ_MSG + "");
stringStringHashMap.put("receiverId", curentClient.getClientId());
sendMsgStatus(curentClient, application, stringStringHashMap, imMsgReadStatusUpdate.getMsgIds());
HashMap<String, String> contentMap = new HashMap<>();
contentMap.put("receiverId", curentClient.getClientId());
sendMsgStatus(curentClient, MsgTypeEnum.CLIENT_READ_MSG, contentMap, imMsgReadStatusUpdate.getMsgIds());
return ApiResult.ok();
......@@ -157,11 +154,11 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
* 下发状态类型消息
*
* @param curentClient 当前客户端
* @param application 当前应用
* @param stringStringHashMap 消息content内容
* @param msgTypeEnum 消息类型枚举
* @param contentMap 消息content内容
* @param msgIds 消息id集合
*/
private void sendMsgStatus(ImClient curentClient, ImApplication application, HashMap<String, String> stringStringHashMap, List<Long> msgIds) {
private void sendMsgStatus(ImClient curentClient, MsgTypeEnum msgTypeEnum, HashMap<String, String> contentMap, List<Long> msgIds) {
// 遍历消息id集合
for (Long msgId : msgIds) {
......@@ -194,9 +191,10 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
// 封装响应的实体
ImMessageOnlineSend imMessageOnlineSend = new ImMessageOnlineSend();
BeanUtils.copyProperties(imMessage, imMessageOnlineSend);
imMessageOnlineSend.setType(msgTypeEnum.getUriCode());
imMessageOnlineSend.setMsgId(imMessage.getId());
imMessageOnlineSend.setSender(curentClient.getClientId());
imMessageOnlineSend.setContent(stringStringHashMap);
imMessageOnlineSend.setContent(contentMap);
imMessageOnlineSend.setConversationId(conversationMember.getFkConversationId());
// 查询接收方
ImClient imClientReceiver = imClientService.getOne(new QueryWrapper<ImClient>().lambda()
......
......@@ -89,12 +89,11 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
imMsgReadLastestMapper.upsertImMsgReceive(lastest);
// 内容
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("type", MsgTypeEnum.CLIENT_RECEIVED_MSG.getUriCode() + "");
stringStringHashMap.put("receiverId", curentClient.getClientId());
HashMap<String, String> contentMap = new HashMap<>();
contentMap.put("receiverId", curentClient.getClientId());
// 推送给接收方
sendMsgStatus(curentClient, stringStringHashMap, lastestMsg);
sendMsgStatus(curentClient, MsgTypeEnum.CLIENT_RECEIVED_MSG, contentMap, lastestMsg);
return ApiResult.ok();
}
......@@ -127,10 +126,9 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
imMsgReadLastestMapper.upsertImMsgRead(lastest);
// 内容
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("type", MsgTypeEnum.CLIENT_READ_MSG + "");
stringStringHashMap.put("receiverId", curentClient.getClientId());
sendMsgStatus(curentClient, stringStringHashMap, lastestMsg);
HashMap<String, String> contentMap = new HashMap<>();
contentMap.put("receiverId", curentClient.getClientId());
sendMsgStatus(curentClient, MsgTypeEnum.CLIENT_READ_MSG, contentMap, lastestMsg);
return ApiResult.ok();
......@@ -182,10 +180,10 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
* 下发状态类型消息
*
* @param curentClient 当前客户端
* @param stringStringHashMap 消息content内容
* @param contentMap 消息content内容
* @param lastestMsg 最新一条待处理消息
*/
private void sendMsgStatus(ImClient curentClient, HashMap<String, String> stringStringHashMap, ImMessage lastestMsg) {
private void sendMsgStatus(ImClient curentClient, MsgTypeEnum msgTypeEnum, HashMap<String, String> contentMap, ImMessage lastestMsg) {
Map<String /** ip **/, List<String /** client的主键ID:platform **/>> onlineIpClientMap =
thousandChatCacheManager.findOnlineHostsByThousandGroupId(lastestMsg.getFkConversationId());
......@@ -193,8 +191,9 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
// 封装响应的实体
ImMessageOnlineSend imMessageOnlineSend = new ImMessageOnlineSend();
imMessageOnlineSend.setMsgId(lastestMsg.getId());
imMessageOnlineSend.setType(msgTypeEnum.getUriCode());
imMessageOnlineSend.setSender(curentClient.getClientId());
imMessageOnlineSend.setContent(stringStringHashMap);
imMessageOnlineSend.setContent(contentMap);
imMessageOnlineSend.setConversationId(lastestMsg.getFkConversationId());
imMessageOnlineSend.setCreateTime(new Date());
imMessageOnlineSend.setWithdraw(false);
......
-- 在feature-cluster 2021年12月22日之后,需要执行的的sql增量脚本
-- 在feature-cluster 2021年12月22日之后,需要执行的的sql增量脚本
-- 在feature-cluster 2021年12月22日之后,需要执行的的sql增量脚本
ALTER TABLE `im_conversation` CHANGE COLUMN `system``system_flag` tinyint(1) NULL DEFAULT NULL COMMENT '可选 对话类型标志,是否是系统对话,后面会说明。' AFTER `attributes`;
ALTER TABLE `im_message` CHANGE COLUMN `system``system_flag` tinyint(1) NULL DEFAULT 0 COMMENT '0非系统通知; 1为系统通知' AFTER `event`;
ALTER TABLE `im_conversation` CHANGE COLUMN `system` `system_flag` tinyint(1) NULL DEFAULT NULL COMMENT '可选 对话类型标志,是否是系统对话,后面会说明。' AFTER `attributes`;
ALTER TABLE `im_message` CHANGE COLUMN `system` `system_flag` tinyint(1) NULL DEFAULT 0 COMMENT '0非系统通知; 1为系统通知' AFTER `event`;
-- 在feature-cluster 2022年1月4日之后,需要执行的sql增量脚本
ALTER TABLE im_conversation
ADD COLUMN`member_count` int NULL COMMENT '群成员数' AFTER`last_message`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment