key_func.go 2.07 KB
Newer Older
chenweijian's avatar
chenweijian committed
1 2 3 4 5 6 7 8
package rediskey

import (
	"fmt"
	"git.hilo.cn/hilo-common/utils"
	"time"
)

chenweijian's avatar
chenweijian committed
9
func GetSlotFruitDailyTimes(userId uint64, nowTime time.Time) string {
chenweijian's avatar
chenweijian committed
10
	var cstZone = time.FixedZone("CST", 3*3600) // 东三区,沙特时间
chenweijian's avatar
chenweijian committed
11
	return fmt.Sprintf(SlotFruitWeeklyDailyTask, nowTime.In(cstZone).Format(utils.DATE_FORMAT), userId)
chenweijian's avatar
chenweijian committed
12 13 14 15
}

func GetOpenRamadanChargeAwardTimes(actId, userId uint64) string {
	return fmt.Sprintf(OpenRamadanChargeAwardTimes, actId, userId)
chenweijian's avatar
chenweijian committed
16
}
chenweijian's avatar
chenweijian committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

func GetOpenRamadanTaskTimesMic(actId, userId uint64) string {
	return fmt.Sprintf(OpenRamadanTaskTimesMic, actId, time.Now().Format(utils.DATE_FORMAT), userId)
}

func GetOpenRamadanTaskTimesLudo(actId, userId uint64) string {
	return fmt.Sprintf(OpenRamadanTaskTimesLudo, actId, time.Now().Format(utils.DATE_FORMAT), userId)
}

func GetOpenRamadanTaskTimesFruit(actId, userId uint64) string {
	return fmt.Sprintf(OpenRamadanTaskTimesFruit, actId, time.Now().Format(utils.DATE_FORMAT), userId)
}

func GetOpenRamadanTaskTimesSlot(actId, userId uint64) string {
	return fmt.Sprintf(OpenRamadanTaskTimesSlot, actId, time.Now().Format(utils.DATE_FORMAT), userId)
}

func GetOpenRamadanTaskTimesEnter(actId, userId uint64) string {
	return fmt.Sprintf(OpenRamadanTaskTimesEnter, actId, time.Now().Format(utils.DATE_FORMAT), userId)
}

func GetOpenRamadanTaskTimesRoom(actId, userId, roomId uint64) string {
	return fmt.Sprintf(OpenRamadanTaskTimesRoom, actId, time.Now().Format(utils.DATE_FORMAT), userId, roomId)
}
chenweijian's avatar
chenweijian committed
41 42 43 44

func GetOpenRamadanFruitBet(actId, userId uint64, round uint, date string) string {
	return fmt.Sprintf(OpenRamadanFruitBet, actId, date, userId, round)
}
chenweijian's avatar
chenweijian committed
45 46 47 48

func GetConvertToTRTCNum() string {
	return fmt.Sprintf(ConvertToTRTCNum, time.Now().Format(utils.DATE_FORMAT))
}
chenweijian's avatar
chenweijian committed
49 50 51 52

func GetUserTmpActId(relateId, userId uint64) string {
	return fmt.Sprintf(TmpActUserActId, relateId, userId)
}
chenweijian's avatar
chenweijian committed
53 54 55 56 57 58 59

func GetActChargeDiamond(userId, actId uint64) string {
	if actId > 500 {
		return fmt.Sprintf(ActIdChargeDiamond, actId, time.Now().Format(utils.DATE_FORMAT), userId)
	}
	return fmt.Sprintf(ActChargeDiamond, time.Now().Format(utils.DATE_FORMAT), userId)
}