|
@@ -1,24 +1,25 @@
|
|
|
package common
|
|
|
|
|
|
import (
|
|
|
- "app.yhyue.com/moapp/MessageCenter/entity"
|
|
|
- "app.yhyue.com/moapp/MessageCenter/rpc/type/message"
|
|
|
- "app.yhyue.com/moapp/MessageCenter/util"
|
|
|
- "app.yhyue.com/moapp/jybase/common"
|
|
|
- m "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
- "app.yhyue.com/moapp/jybase/redis"
|
|
|
"context"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
"log"
|
|
|
"strconv"
|
|
|
"time"
|
|
|
+
|
|
|
+ "app.yhyue.com/moapp/MessageCenter/entity"
|
|
|
+ "app.yhyue.com/moapp/MessageCenter/rpc/type/message"
|
|
|
+ "app.yhyue.com/moapp/MessageCenter/util"
|
|
|
+ "app.yhyue.com/moapp/jybase/common"
|
|
|
+ m "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
+ "app.yhyue.com/moapp/jybase/redis"
|
|
|
)
|
|
|
|
|
|
func BitmapUserMsgList(this *message.UserMsgListReq) (*message.UserMsgList, *message.Messages) {
|
|
|
var (
|
|
|
- unread, count int64
|
|
|
- data = new(message.UserMsgList)
|
|
|
+ unread, count, toDoUnread int64
|
|
|
+ data = new(message.UserMsgList)
|
|
|
)
|
|
|
//取出用户所有消息、已读消息id bitmap 查库
|
|
|
userAllMsgArr, _, userUnreadArr, err := GetUserMsgSummary(this.UserId)
|
|
@@ -32,8 +33,10 @@ func BitmapUserMsgList(this *message.UserMsgListReq) (*message.UserMsgList, *mes
|
|
|
//fmt.Println("用户所有消息数:", userAllMsgArr, "已读消息数:", userReadArr, "未读消息数:", userUnreadArr)
|
|
|
//导航未读消息总数
|
|
|
if !this.IsMsgList && !this.IsColumnNewMsg && !this.IsColumn { //消息未读数统计
|
|
|
- _, unread = BitmapCountUnread(this.UserId, classUnreadCountMap, true)
|
|
|
+ var sortUnread map[string]int64
|
|
|
+ sortUnread, unread = BitmapCountUnread(this.UserId, classUnreadCountMap, true)
|
|
|
data.Unread = unread
|
|
|
+ data.toDoUnread = sortUnread["11"]
|
|
|
return data, nil
|
|
|
}
|
|
|
//获取栏目下的数据
|
|
@@ -126,6 +129,7 @@ func BitmapUserMsgList(this *message.UserMsgListReq) (*message.UserMsgList, *mes
|
|
|
sortUnread, total := BitmapCountUnread(this.UserId, classUnreadCountMap, false)
|
|
|
//fmt.Println("*************", total)
|
|
|
unread += total
|
|
|
+ toDoUnread = sortUnread["11"]
|
|
|
for _, v := range entity.MessageColumn {
|
|
|
var column message.AllSortData
|
|
|
column.Name = common.InterfaceToStr(v["name"])
|
|
@@ -250,6 +254,7 @@ func BitmapUserMsgList(this *message.UserMsgListReq) (*message.UserMsgList, *mes
|
|
|
}
|
|
|
}
|
|
|
data.Unread = unread
|
|
|
+ data.ToDoUnread = toDoUnread
|
|
|
//置顶消息
|
|
|
if len(classUnreadMsgMap[1]) > 0 {
|
|
|
activeMsgArr := classUnreadMsgMap[1]
|