Commit 076e2eee authored by chenweijian's avatar chenweijian

活动

parent 61017153
...@@ -38,4 +38,8 @@ const ( ...@@ -38,4 +38,8 @@ const (
// 开斋节活动 // 开斋节活动
OpenRamadanSendGiftLeftDiamond = "act:openRamadan:diamond:%d:%d" // 开斋节活动,剩余还没转换成积分的送礼钻石,活动id:用户id OpenRamadanSendGiftLeftDiamond = "act:openRamadan:diamond:%d:%d" // 开斋节活动,剩余还没转换成积分的送礼钻石,活动id:用户id
ResCountry = "res:country" // 国家列表
// 定时任务的互斥锁
cronLock = "cronLock:{subKey}"
) )
...@@ -3,6 +3,7 @@ package rediskey ...@@ -3,6 +3,7 @@ package rediskey
import ( import (
"fmt" "fmt"
"git.hilo.cn/hilo-common/utils" "git.hilo.cn/hilo-common/utils"
"strings"
"time" "time"
) )
...@@ -57,3 +58,27 @@ func GetActChargeDiamond(userId, actId uint64) string { ...@@ -57,3 +58,27 @@ func GetActChargeDiamond(userId, actId uint64) string {
} }
return fmt.Sprintf(ActChargeDiamond, time.Now().Format(utils.DATE_FORMAT), userId) return fmt.Sprintf(ActChargeDiamond, time.Now().Format(utils.DATE_FORMAT), userId)
} }
func GetActChargeGetPoint(userId, actId uint64, dollar int64) string {
if actId > 500 {
return fmt.Sprintf(ActIdChargeGetPoint, actId, time.Now().Format(utils.DATE_FORMAT), dollar, userId)
}
return fmt.Sprintf(ActChargeGetPoint, time.Now().Format(utils.DATE_FORMAT), dollar, userId)
}
func GetMonthChargeTimes(userId uint64) string {
var cstZone = time.FixedZone("CST", 3*3600) // 东三区,沙特时间
return fmt.Sprintf(MonthChargeTimes, time.Now().In(cstZone).Format(utils.MONTH_FORMAT), userId)
}
func GetRamadanDailyTaskGet(actId, userId uint64, nowTime time.Time) string {
return fmt.Sprintf(RamadanDailyTaskGet, nowTime.Format(utils.DATE_FORMAT), actId, userId)
}
func GetRamadanGetDailyLottery(actId, userId uint64) string {
return fmt.Sprintf(RamadanGetDailyLottery, time.Now().Format(utils.DATE_FORMAT), actId, userId)
}
func GetCronLockKey(subKey string) string {
return strings.Replace(cronLock, "{subKey}", subKey, -1)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment