You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
Go
38 lines
1.3 KiB
Go
package ckey
|
|
|
|
import "fmt"
|
|
|
|
func gameKey(format string, a ...any) string {
|
|
return Game + fmt.Sprintf(format, a...)
|
|
}
|
|
|
|
// GameLinkInit 初始化游戏默认链接
|
|
func GameLinkInit(projectId, gameId int64) string {
|
|
return gameKey("link_init:%d_%d", projectId, gameId)
|
|
}
|
|
|
|
// GameTotalCreateOnce 行为统计只有能同时创建一个
|
|
func GameTotalCreateOnce(projectId, gameId, linkId int64) string {
|
|
return gameKey("total_create_once:%d_%d_%d", projectId, gameId, linkId)
|
|
}
|
|
|
|
// GameTotalCreateOnceDate 行为统计只有能同时创建一个
|
|
func GameTotalCreateOnceDate(projectId, gameId, linkId int64, date string) string {
|
|
return gameKey("total_create_once_date:%d_%d_%d_%s", projectId, gameId, linkId, date)
|
|
}
|
|
|
|
// GameActionFirst 行为统计只有能同时创建一个
|
|
func GameActionFirst(projectId, gameId, linkId, userId int64, t int32) string {
|
|
return gameKey("action_first:%d_%d_%d_%d_%d", projectId, gameId, linkId, userId, t)
|
|
}
|
|
|
|
// GameActionFirstDate 行为统计只有能同时创建一个
|
|
func GameActionFirstDate(projectId, gameId, linkId, userId int64, t int32, date string) string {
|
|
return gameKey("action_first_date:%d_%d_%d_%d_%d_%s", projectId, gameId, linkId, userId, t, date)
|
|
}
|
|
|
|
// GameActionStayId 行为统计只有能同时创建一个
|
|
func GameActionStayId(userId, linkId int64) string {
|
|
return gameKey("action_stay_id:%d_%d", userId, linkId)
|
|
}
|