Commit 595bc14d by Future

content中type字段拆出

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