superGroupMaxSeq

This commit is contained in:
wangchuxiao
2022-07-26 15:20:48 +08:00
12 changed files with 613 additions and 45 deletions
+11
View File
@@ -31,6 +31,7 @@ const (
SignalCache = "SIGNAL_CACHE:"
SignalListCache = "SIGNAL_LIST_CACHE:"
GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT"
FcmToken = "FCM_TOKEN:"
groupUserMinSeq = "GROUP_USER_MIN_SEQ:"
groupMaxSeq = "GROUP_MAX_SEQ"
sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG"
@@ -373,3 +374,13 @@ func (d *DataBases) SetSendMsgFailedFlag(operationID string) error {
func (d *DataBases) GetSendMsgStatus(operationID string) error {
return d.RDB.Get(context.Background(), sendMsgFailedFlag+operationID).Err()
}
func (d *DataBases) SetFcmToken(account string, platformid int, fcmToken string, expireTime int64) (err error) {
key := FcmToken + account + ":" + strconv.Itoa(platformid)
return d.RDB.Set(context.Background(), key, fcmToken, time.Duration(expireTime)*time.Second).Err()
}
func (d *DataBases) GetFcmToken(account string, platformid int) (string, error) {
key := FcmToken + account + ":" + strconv.Itoa(platformid)
return d.RDB.Get(context.Background(), key).Result()
}