|
@@ -150,6 +150,9 @@ func MsgCountAdd(userId, msgType string) bool {
|
|
|
// MsgCountMinusOne 根据消息类型未读消息数量减1
|
|
|
func MsgCountMinusOne(userId, msgType string) bool {
|
|
|
keyString := fmt.Sprintf(MsgCountKey, userId, msgType)
|
|
|
+ if redis.GetInt(redisModule, keyString) <= 0 {
|
|
|
+ return redis.Put(redisModule, keyString, 0, -1)
|
|
|
+ }
|
|
|
in := redis.Decrby(redisModule, keyString, 1)
|
|
|
return in > 0
|
|
|
}
|