diff --git a/_const/rediskey/key.go b/_const/rediskey/key.go index 2bd5757f9a89b52deb43b17f817cc3f8ce26572a..8172ad0ab5bf4c44cc4d04a5e4b0a07a2eea9584 100644 --- a/_const/rediskey/key.go +++ b/_const/rediskey/key.go @@ -42,4 +42,7 @@ const ( // 定时任务的互斥锁 cronLock = "cronLock:{subKey}" + + ActIpGetAwardTimes = "act:ipAwardTimes:%d:%d:%s" // 一个ip在活动中的领奖次数 活动id:领奖类型:ip地址 + ActDeviceGetAwardTimes = "act:deviceAwardTimes:%d:%d:%s" // 一个设备在活动中的领奖次数 活动id:领奖类型:设备号 ) diff --git a/_const/rediskey/key_func.go b/_const/rediskey/key_func.go index b704c10880b2dcfd65b9693b3f7793e62ec18720..150cfa39e62e72727985d7813deaf8fba0fd0e66 100644 --- a/_const/rediskey/key_func.go +++ b/_const/rediskey/key_func.go @@ -82,3 +82,11 @@ func GetRamadanGetDailyLottery(actId, userId uint64) string { func GetCronLockKey(subKey string) string { return strings.Replace(cronLock, "{subKey}", subKey, -1) } + +func GetActIpGetAwardTimesKey(actId uint64, awardType int, ip string) string { + return fmt.Sprintf(ActIpGetAwardTimes, actId, awardType, ip) +} + +func GetActDeviceGetAwardTimesKey(actId uint64, awardType int, device string) string { + return fmt.Sprintf(ActDeviceGetAwardTimes, actId, awardType, device) +}