config.go
5.24 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package cardholder
import (
"apigame/service/constd"
"apigame/util/utdto"
)
// CardActivityUpdateConfig 卡牌活动更新配置
type CardActivityUpdateConfig struct {
Id int64 // ID
Status int // 状态 0=关闭 1=开启
UpdateTime int64 // 修改时间戳
}
func (d *CardActivityUpdateConfig) TableName() string {
return utdto.MYSQL_TABLE_TEMPLATE
}
func (d *CardActivityUpdateConfig) GetTableName(gameId string) string {
return constd.MYSQL_TABLE_S_CARDHOLDER_CONFIG + gameId
}
// CardActivityConfig 卡牌活动配置 分析后数据
type CardActivityConfig struct {
Raw *CardActivityConfigRaw
Client *CardActivityConfigClient
GameId string // 所属游戏ID
Id int64 // ID
Awards map[string]string // 奖励配置
AlbumConfig map[int]AlbumConfig // 卡组配置
CardConfig map[int]CardConfig // 卡牌配置
CardholderConfig map[string]OpenCardholderConfig // 卡包开卡规则
NormalCardStarConfig map[string]NormalCardStarConfig // k=ID_用户序列_用户分组 卡片星级配置
CardSequenceConfig map[string]CardSequenceConfig // k=ID_用户序列_用户分组 卡片星级对应卡牌配置
StarShopConfig map[int]StarShopConfig // 星星商店配置
}
// CardActivityConfigRaw 卡牌活动配置 原始数据
type CardActivityConfigRaw 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 (d *CardActivityConfigRaw) TableName() string {
return utdto.MYSQL_TABLE_TEMPLATE
}
func (d *CardActivityConfigRaw) GetTableName(gameId string) string {
return constd.MYSQL_TABLE_S_CARDHOLDER_CONFIG + gameId
}
// AlbumConfig 卡组表
type AlbumConfig struct {
SetId int `json:"set_id"` // 卡组名
Name int `json:"name"` // 卡组图片
Icon string `json:"icon"` // 卡组id
Rewards map[string]string `json:"rewards"` // 集齐奖励 k=轮次
StartTime int64 `json:"start_time"` // 开始时间
EndTime int64 `json:"end_time"` // 结束时间
}
// CardConfig 卡牌表
type CardConfig struct {
Id int `json:"id"` // ID
Name int `json:"name"` // 卡牌名字
Icon int `json:"icon"` // 卡牌图标
Desc int `json:"desc"` // 卡牌描述
SetId int `json:"album_setid"` // 卡组id
Star int `json:"star"` // 星级
IsGold int `json:"is_gold"` // 是否是金卡
IsSend int `json:"is_send"` // 卡片是否可赠送
}
// OpenCardholderConfig 卡包开卡规则表
type OpenCardholderConfig struct {
Id string `json:"id"` // ID
IsGoldCardholder int `json:"is_gold_card_holder"` // 是否是金卡包
IsNew int `json:"is_new"` // 是否是新卡包
GuaranteedStarCardId string `json:"guaranteed_star_card_id"` // 保底卡星级序列ID
NormalCardNumber int `json:"normal_card_number"` // 非保底卡数量
MinimumGuaranteeCardId string `json:"minimum_guarantee_card_id"` // 非保底卡牌序列ID
ActivityId int `json:"activity_id"` // 对应活动ID
}
// NormalCardStarConfig 非保底卡星级ID
type NormalCardStarConfig struct {
Id string `json:"id"` // ID
SequenceId string `json:"user_sequence_id"` // 用户序列组ID
Cohort string `json:"cohort"` // 用户分组
NormalCardSequenceId string `json:"normal_card_sequence_id"` // 非保底星级序列
NormalCardSequenceIds []string `json:"-"` // 非保底星级序列
}
// CardSequenceConfig 星级ID对应的卡片
type CardSequenceConfig struct {
Id string `json:"id"` // ID
SequenceId string `json:"user_sequence_id"` // 用户序列组ID
Cohort string `json:"cohort"` // 用户分组
CardIdList string `json:"card_id_list"` // 卡牌抽取序列
CardIdLists []string `json:"-"` // 卡牌抽取序列
}
// StarShopConfig 星星商店配置
type StarShopConfig struct {
Id int `json:"id"` // ID
NeedStarNumber int `json:"need_star_number"` // 需求星星数
CardBagIds []int `json:"card_bag_ids"` // 可换取的卡包ID {卡包类型,卡包ID,卡包数量}
}