keys.go 734 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11 12
package mic_k

import (
	"fmt"
	"git.hilo.cn/hilo-common/resource/mysql"
	"hilo-group/_const/redis_key"
	"time"
)

const (
	MicPrefix    = "mic:"
	MicDayInvite = MicPrefix + "day:invite:${userId}:${date}" // string 自动被邀请上麦,1天一次,TTL:24H
13 14

	MicGroupPowerOnMic = MicPrefix + "groupPower:${userId}:${date}" // 家族内群上麦分钟数
hujiebin's avatar
hujiebin committed
15 16 17 18 19 20
)

func GetUserMicDayInvite(userId mysql.ID) string {
	date := time.Now().Format("2006-01-02")
	return redis_key.ReplaceKey(MicDayInvite, fmt.Sprintf("%d", userId), date)
}
21 22 23 24 25 26

// 家族内群上麦分钟数
func GetMicGroupPowerOnMic(userId uint64) string {
	date := time.Now().Format("2006-01-02")
	return redis_key.ReplaceKey(MicGroupPowerOnMic, fmt.Sprintf("%d", userId), date)
}