Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release

This commit is contained in:
wangchuxiao
2022-09-01 21:18:46 +08:00
14 changed files with 217 additions and 199 deletions
+10
View File
@@ -37,6 +37,7 @@ const (
groupMaxSeq = "GROUP_MAX_SEQ:"
groupMinSeq = "GROUP_MIN_SEQ:"
sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:"
userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:"
)
func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) {
@@ -411,3 +412,12 @@ func (d *DataBases) GetFcmToken(account string, platformid int) (string, error)
key := FcmToken + account + ":" + strconv.Itoa(platformid)
return d.RDB.Get(context.Background(), key).Result()
}
func (d *DataBases) IncrUserBadgeUnreadCountSum(uid string) (int, error) {
key := userBadgeUnreadCountSum + uid
seq, err := d.RDB.Incr(context.Background(), key).Result()
return int(seq), err
}
func (d *DataBases) SetUserBadgeUnreadCountSum(uid string, value int) error {
key := userBadgeUnreadCountSum + uid
return d.RDB.Set(context.Background(), key, value, 0).Err()
}