This commit is contained in:
wangchuxiao
2022-04-08 15:40:07 +08:00
parent 59cc45eaab
commit 4efdabc1ff
14 changed files with 240 additions and 43 deletions
+11
View File
@@ -14,6 +14,7 @@ const (
userMinSeq = "REDIS_USER_MIN_SEQ:"
uidPidToken = "UID_PID_TOKEN_STATUS:"
conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:"
GetuiToken = "GETUI"
)
func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) {
@@ -144,3 +145,13 @@ func (d *DataBases) GetMultiConversationMsgOpt(userID string, conversationIDs []
return m, nil
}
func (d *DataBases) SetGetuiToken(token string, expireTime int64) error {
_, err := d.Exec("SET", GetuiToken, token, "ex", expireTime)
return err
}
func (d *DataBases) GetGetuiToken() (string, error) {
result, err := redis.String(d.Exec("GET", GetuiToken))
return result, err
}