123456789101112131415161718192021 |
- package sphsd
- import (
- "active/constant"
- "fmt"
- "git.jiaxianghudong.com/webs/pkg/rds"
- "time"
- )
- func GetData(userId, tm string) string {
- data := rds.Redis.HGet(fmt.Sprintf(constant.SPHSD, tm), userId).Val()
- return data
- }
- func SetData(userId, tm string, endTm string) bool {
- rds.Redis.HSet(fmt.Sprintf(constant.SPHSD, tm), userId, "1")
- end, _ := time.Parse("2006-01-02 15:04:05", endTm)
- expireAt := end.Add(1 * time.Hour)
- rds.Redis.ExpireAt(fmt.Sprintf(constant.SPHSD, tm), expireAt)
- return true
- }
|