增加小程序前台显示租户发送的未读消息,

This commit is contained in:
wen 2022-01-16 20:03:25 +08:00
parent 80c41b4662
commit 7731bcd6cb
2 changed files with 10 additions and 2 deletions

View File

@ -68,7 +68,7 @@ public interface XhpcMessageBoardService {
QueryUserListResponse queryUserList(QueryUserListRequest param) throws Exception;
/**
* 平台查询用户发送过来的信息与用户查看它自己的信息一致
* 平台查询用户发送过来的信息与用户查看它自己的信息逻辑是一致
*
* @param userQueryCondition 要查询的用户的信息
* @return 返回用户与平台用户的一个月的聊天记录

View File

@ -154,7 +154,15 @@ public class XhpcMessageBoardServiceImpl implements XhpcMessageBoardService {
platformRequest.setTenantId(sysUser.getTenantId());
platformRequest.setTenantType(0);
messageBoardMapper.insertPlatformMessage(platformRequest);
//往Redis中放置用户未读数量
String userNotReadCount = "userNotReadMessageCount:" + platformRequest.getSenderType() + ":" + platformRequest.getSenderAccount() + ":" + "0:" + sysUser.getTenantId();
Object cacheObject1 = redisService.getCacheObject(userNotReadCount);
if (cacheObject1 == null) {
redisService.setCacheObject(userNotReadCount, 1);
} else {
Integer userNotReadNum = (Integer) cacheObject1 + 1;
redisService.setCacheObject(userNotReadCount, userNotReadNum);
}
}
/**