This commit is contained in:
richboo111
2023-09-19 10:24:12 +08:00
parent df03f21b40
commit 14ee75684e
2 changed files with 15 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"strings"
"time"
"git.rosy.net.cn/jx-callback/business/partner"
@@ -276,14 +277,24 @@ func GetImUserList(req []RelInfo) (map[string][]interface{}, error) {
for _, j := range keys {
temp := rdb.LRange(j)
for _, v := range temp {
retVal[j] = append(retVal[j], v)
//暂时写死
//retVal["userList"] = append(retVal["userList"], v)
//过滤过期信息
if FilterUserList(v) {
retVal[j] = append(retVal[j], v)
}
}
}
return retVal, nil
}
func FilterUserList(val string) bool {
retVal := UserMessageList{}
err := json.Unmarshal([]byte(val), &retVal)
if err != nil || time.Now().Unix()-int64(retVal.LatestTime) >= 3600*6 {
return false
}
return true
}
// GetImChatDetail 获取门店用户聊天详情
func GetImChatDetail(req []UserRelInfo) (map[string][]interface{}, error) {
retVal := make(map[string][]interface{}, 0)