cardholder-record.go
5.79 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package dto
import (
"apigame/service/constd"
"apigame/util/util-lx/lxtime"
"fmt"
)
// CardHolderRecordGetNew 开卡包活动日志获得卡包
type CardHolderRecordGetNew struct {
Id int64 `orm:"auto"` // 日志ID
Uid int64 // 玩家唯一ID
ActivityId int64 // 当前活动ID
Round int // 当前轮次
CardholderId int // 卡包ID
CardholderCount int // 卡包数量
CreateTime int64 // 创建时间戳
UpdateTime int64 // 修改时间戳
}
func (d *CardHolderRecordGetNew) TableName(gameId string) string {
return constd.MYSQL_TABLE_S_CARDHOLDER_RECORD_GETNEW + gameId
}
func (d *CardHolderRecordGetNew) CreateSqlPath() string {
return constd.MYSQL_TABLE_S_CARDHOLDER_RECORD_GETNEW
}
func (d *CardHolderRecordGetNew) SqlPairs() map[string]string {
m := make(map[string]string)
m["uid"] = fmt.Sprintf("%d", d.Uid)
m["activity_id"] = fmt.Sprintf("%d", d.ActivityId)
m["round"] = fmt.Sprintf("%d", d.Round)
m["cardholder_id"] = fmt.Sprintf("%d", d.CardholderId)
m["cardholder_count"] = fmt.Sprintf("%d", d.CardholderCount)
m["create_time"] = fmt.Sprintf("%d", d.CreateTime)
m["update_time"] = fmt.Sprintf("%d", d.UpdateTime)
return m
}
func NewCardHolderRecordGetNew(uid int64, activityId int64, round int,
cardholderId int, cardholderCount int) *CardHolderRecordGetNew {
secNow := lxtime.NowUninx()
return &CardHolderRecordGetNew{
CreateTime: secNow,
UpdateTime: secNow,
Uid: uid,
ActivityId: activityId,
Round: round,
CardholderId: cardholderId,
CardholderCount: cardholderCount,
}
}
// CardHolderRecordOpen 开卡包活动日志开卡包
type CardHolderRecordOpen struct {
Id int64 `orm:"auto"` // 日志ID
Uid int64 // 玩家唯一ID
ActivityId int64 // 当前活动ID
Round int // 当前轮次
CardholderId int // 卡包ID
CardList string // 开卡内容
CreateTime int64 // 创建时间戳
UpdateTime int64 // 修改时间戳
}
func (d *CardHolderRecordOpen) TableName(gameId string) string {
return constd.MYSQL_TABLE_S_CARDHOLDER_RECORD_OPEN + gameId
}
func (d *CardHolderRecordOpen) CreateSqlPath() string {
return constd.MYSQL_TABLE_S_CARDHOLDER_RECORD_OPEN
}
func (d *CardHolderRecordOpen) SqlPairs() map[string]string {
m := make(map[string]string)
m["uid"] = fmt.Sprintf("%d", d.Uid)
m["activity_id"] = fmt.Sprintf("%d", d.ActivityId)
m["round"] = fmt.Sprintf("%d", d.Round)
m["cardholder_id"] = fmt.Sprintf("%d", d.CardholderId)
m["card_list"] = fmt.Sprintf("'%s'", d.CardList)
m["create_time"] = fmt.Sprintf("%d", d.CreateTime)
m["update_time"] = fmt.Sprintf("%d", d.UpdateTime)
return m
}
func NewCardHolderRecordOpen(uid int64, activityId int64, round int,
cardholderId int, cardList string) *CardHolderRecordOpen {
secNow := lxtime.NowUninx()
return &CardHolderRecordOpen{
CreateTime: secNow,
UpdateTime: secNow,
Uid: uid,
ActivityId: activityId,
Round: round,
CardholderId: cardholderId,
CardList: cardList,
}
}
// CardHolderRecordRewardAlbum 开卡包活动日志领取卡组奖励
type CardHolderRecordRewardAlbum struct {
Id int64 `orm:"auto"` // 日志ID
Uid int64 // 玩家唯一ID
ActivityId int64 // 当前活动ID
Round int // 当前轮次
AlbumId int // 卡组ID
Award string // 奖励内容
CreateTime int64 // 创建时间戳
UpdateTime int64 // 修改时间戳
}
func (d *CardHolderRecordRewardAlbum) TableName(gameId string) string {
return constd.MYSQL_TABLE_S_CARDHOLDER_RECORD_REWARDALBUM + gameId
}
func (d *CardHolderRecordRewardAlbum) CreateSqlPath() string {
return constd.MYSQL_TABLE_S_CARDHOLDER_RECORD_REWARDALBUM
}
func (d *CardHolderRecordRewardAlbum) SqlPairs() map[string]string {
m := make(map[string]string)
m["uid"] = fmt.Sprintf("%d", d.Uid)
m["activity_id"] = fmt.Sprintf("%d", d.ActivityId)
m["round"] = fmt.Sprintf("%d", d.Round)
m["album_id"] = fmt.Sprintf("%d", d.AlbumId)
m["award"] = fmt.Sprintf("'%s'", d.Award)
m["create_time"] = fmt.Sprintf("%d", d.CreateTime)
m["update_time"] = fmt.Sprintf("%d", d.UpdateTime)
return m
}
func NewCardHolderRecordRewardAlbum(uid int64, activityId int64, round int,
albumId int, award string) *CardHolderRecordRewardAlbum {
secNow := lxtime.NowUninx()
return &CardHolderRecordRewardAlbum{
CreateTime: secNow,
UpdateTime: secNow,
Uid: uid,
ActivityId: activityId,
Round: round,
AlbumId: albumId,
Award: award,
}
}
// CardHolderRecordRewardRound 开卡包活动日志领取轮次奖励
type CardHolderRecordRewardRound struct {
Id int64 `orm:"auto"` // 日志ID
Uid int64 // 玩家唯一ID
ActivityId int64 // 当前活动ID
Round int // 当前轮次
Award string // 奖励内容
CreateTime int64 // 创建时间戳
UpdateTime int64 // 修改时间戳
}
func (d *CardHolderRecordRewardRound) TableName(gameId string) string {
return constd.MYSQL_TABLE_S_CARDHOLDER_RECORD_REWARDROUND + gameId
}
func (d *CardHolderRecordRewardRound) CreateSqlPath() string {
return constd.MYSQL_TABLE_S_CARDHOLDER_RECORD_REWARDROUND
}
func (d *CardHolderRecordRewardRound) SqlPairs() map[string]string {
m := make(map[string]string)
m["uid"] = fmt.Sprintf("%d", d.Uid)
m["activity_id"] = fmt.Sprintf("%d", d.ActivityId)
m["round"] = fmt.Sprintf("%d", d.Round)
m["award"] = fmt.Sprintf("'%s'", d.Award)
m["create_time"] = fmt.Sprintf("%d", d.CreateTime)
m["update_time"] = fmt.Sprintf("%d", d.UpdateTime)
return m
}
func NewCardHolderRecordRewardRound(uid int64, activityId int64, round int,
award string) *CardHolderRecordRewardRound {
secNow := lxtime.NowUninx()
return &CardHolderRecordRewardRound{
CreateTime: secNow,
UpdateTime: secNow,
Uid: uid,
ActivityId: activityId,
Round: round,
Award: award,
}
}