package utils import ( "fmt" "git.getensh.com/common/gopkgs/cache" "property-applete-gateway/errors" ) const SingleSignKeyPrefix = "single_sign_" func SetSingleSignTime(uid int64, timestamp int64) error { key := SingleSignKeyPrefix + fmt.Sprintf("%d", uid) _, err := cache.Redis().Set(key, fmt.Sprintf("%d", timestamp)) if err != nil { return errors.RedisError } return nil } func GetSingleSignTime(uid int64) string{ key := SingleSignKeyPrefix + fmt.Sprintf("%d", uid) str, _ := cache.Redis().Get(key) return str }