Sfoglia il codice sorgente

新用户消息修改

renjiaojiao 1 anno fa
parent
commit
84d4a94c9a

+ 5 - 2
rpc/internal/common/messageService.go

@@ -3,11 +3,14 @@ package common
 import (
 	"app.yhyue.com/moapp/MessageCenter/entity"
 	"app.yhyue.com/moapp/MessageCenter/rpc/type/message"
+	"app.yhyue.com/moapp/MessageCenter/util"
 	qutil "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/redis"
 	"context"
 	"errors"
 	"fmt"
+	"log"
+	"strings"
 	"time"
 )
 
@@ -37,7 +40,7 @@ func (service *MessageService) ChangeReadStatus(data *message.ChangeReadStatusRe
 }
 
 // 未读消息合计 isRedis 是否需要初始化redis
-/*func (service *MessageService) CountUnread(userId string, isRedis bool) (map[string]int64, int64) {
+func (service *MessageService) CountUnread(userId string, isRedis bool) (map[string]int64, int64) {
 	var (
 		count              int64
 		msgTypes, groupIds []string
@@ -105,7 +108,7 @@ func (service *MessageService) CountClassUnread(userId string, groupId int64) (c
 	}
 
 	return data, count
-}*/
+}
 
 // 查询消息详情
 func FindMessageDetail(id, msgLogId int64, userId string) (msg *map[string]interface{}, err error) {

+ 1 - 0
rpc/internal/common/msglistService.go

@@ -319,6 +319,7 @@ func BitmapCountClassUnread(userId string, groupId int64, classUnreadCountMap ma
 	//classUnreadCountMap, _ := FindUserClassUnread(userId)
 	for i := 0; i < len(entity.ClassSearchMap[groupId]); i++ {
 		msgClass := entity.ClassSearchMap[groupId][i]
+		fmt.Println("msgClass", msgClass)
 		key := fmt.Sprintf(MsgClassCountKey, userId, msgClass.MsgType)
 		if exists, _ := redis.Exists(redisModule, key); exists {
 			ct := util.Int64All(redis.GetInt(redisModule, key))

+ 2 - 2
rpc/internal/common/sendMsg.go

@@ -98,7 +98,7 @@ func FindUserMsg(this message.FindUserMsgReq, isClean bool) message.FindUserMsgR
 	return data
 }
 
-/*func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
+func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 	var (
 		unread, count int64
 	)
@@ -263,7 +263,7 @@ func FindUserMsg(this message.FindUserMsgReq, isClean bool) message.FindUserMsgR
 
 	data.Unread = unread
 	return data
-}*/
+}
 
 func unreadMsg(this *message.UserMsgListReq) int64 {
 	if this.PositionId <= 0 {