feat-roomrank.go
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package configs
import (
"apigame/service-common/svconst"
"apigame/service-common/svmysql"
"apigame/service-common/svredis"
"fmt"
)
// RoomRankConfig 房间排行活动配置 分析后数据
type RoomRankConfig struct {
Raw *RoomRankConfigRaw `json:"-"`
Id int64 // ID
Client *RoomRankConfigClient
GameId string // 所属游戏ID
}
func (c *RoomRankConfig) RedisInfo(gameId string) *svredis.RedisInfo {
tableName := svconst.MYSQL_TABLE_S_ROOMRANK_CONFIG
return &svredis.RedisInfo{
CacheKey: fmt.Sprintf("%s:%s:%s", svconst.REDIS_CACHEP_REFIX, tableName, gameId),
CacheTime: 300,
}
}
// RoomRankConfigRaw 卡牌活动配置 原始数据
type RoomRankConfigRaw struct {
Id int64 // ID
OpenLevel int // 开启等级
PreviewTime int64 // 预告时间
StartTime int64 // 开始时间
EndTime int64 // 结束时间
Round int // 轮数
Awards string `json:"-"` // 奖励配置
AlbumConfig string `json:"-"` // 卡组配置
CardConfig string `json:"-"` // 卡牌配置
CardHolderConfig string `json:"-"` // 卡包开卡规则
NormalCardStarSequence string `json:"-"` // 卡片星级配置
CardSequenceConfig string `json:"-"` // 卡片星级对应卡牌配置
StarShopConfig string `json:"-"` // 星星商店配置
Ver string // 版本号
Status int // 状态 0=关闭 1=开启
UpdateTime int64 // 修改时间戳
}
func (c *RoomRankConfigRaw) MysqlInfo(gameId string) *svmysql.MysqlInfo {
tableName := svconst.MYSQL_TABLE_S_ROOMRANK_CONFIG
return &svmysql.MysqlInfo{
DbMysql: svconst.DbConfig.Where("status = ?", 1),
TableName: tableName + gameId,
}
}
// RoomRankConfigClient 卡牌活动配置 给客户端数据
type RoomRankConfigClient struct {
Id int64 `form:"id" json:"id"` // ID
}