Documentation
¶
Index ¶
- Constants
- Variables
- func GetTodayTotalNum() int64
- func GetYesterdayNum() int64
- func Init(db *gorm.DB, rdb *redis2.Client)
- func SignGetTodayNum() int64
- func SignToday() int64
- func SignUser(userID uint32) (int64, error)
- func SignUserCheckToday(userID uint32) bool
- func SignUserGetUint8(userID uint32) []int64
- func TotalToday() int64
- type Config
- type SignData
- type SignDay
- type SignInfo
Constants ¶
View Source
const ( TagTodayTotal = "sign:today" // 今日签到 TagUser = "sign:user" // 签到人 )
View Source
const ( Sign3Day = 7 // 7 => 0000 0111 Sign7Day = 127 // 127 => 01111 1111 )
View Source
const (
OneDayTime = 3600 * 24
)
Variables ¶
View Source
var CurrentKey string
Functions ¶
Types ¶
type Config ¶
type Config struct {
NumDaysAgo int64 `json:"num_days_ago"` // 距今多少天, 为第一天(至少为当前天数 - 20天, 防止偏移超出范围)
}
type SignData ¶
type SignData struct { Consecutive3 bool // 连续三天 Consecutive7 bool // 连续七天 ConsecutiveNum int // 连续签到几天 List []SignInfo // 打卡情况 }
func SignUserGetInfo ¶
SignUserGetInfo 获取近8日打卡情况
Click to show internal directories.
Click to hide internal directories.