dto-record.go
3.35 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
package cardholder
import (
"apigame/service-common/svconst"
"apigame/service-common/svmysql"
"apigame/util/util-lx/lxtime"
"fmt"
)
// RecordBase 日志公共
type RecordBase struct {
Id int64 `gorm:"primaryKey;comment:日志ID"`
Uid int64 `gorm:"comment:玩家唯一ID"`
SequenceId int `gorm:"comment:用户序列组ID"`
Cohort int `gorm:"comment:用户分组ID"`
ActivityId int64 `gorm:"comment:当前活动ID"`
Round int `gorm:"comment:当前轮次"`
CreateTime int64 `gorm:"comment:创建时间戳"`
UpdateTime int64 `gorm:"comment:修改时间戳"`
}
func NewRecordBase(uid int64, sequenceId int, cohort int, activityId int64, round int) RecordBase {
secNow := lxtime.NowUninx()
return RecordBase{
CreateTime: secNow,
UpdateTime: secNow,
Uid: uid,
SequenceId: sequenceId,
Cohort: cohort,
ActivityId: activityId,
Round: round,
}
}
// RecordOpen 打开卡包
type RecordOpen struct {
RecordBase
OpenMode int `gorm:"comment:开包类型0客户端驱动1星星商店购买2剩余星星兑换"`
CardholderId int `gorm:"comment:卡包ID"`
CardList string `gorm:"type:varchar(255);comment:开卡内容"`
}
func (d *RecordOpen) MysqlInfo(suffix string) *svmysql.MysqlInfo {
tableName := svconst.MYSQL_TABLE_S_CARDHOLDER_RECORD_OPEN
return &svmysql.MysqlInfo{
DbMysql: svconst.DbCommon,
TableName: fmt.Sprintf("%s_%s", tableName, suffix),
}
}
func NewRecordOpen(recordBase RecordBase,
openMode int, cardholderId int, cardList string) *RecordOpen {
return &RecordOpen{
RecordBase: recordBase,
OpenMode: openMode,
CardholderId: cardholderId,
CardList: cardList,
}
}
// RecordCardAdd 获取新卡
type RecordCardAdd struct {
RecordBase
CardId int `gorm:"comment:卡牌ID"`
}
func (d *RecordCardAdd) MysqlInfo(suffix string) *svmysql.MysqlInfo {
tableName := svconst.MYSQL_TABLE_S_CARDHOLDER_RECORD_CARDADD
return &svmysql.MysqlInfo{
DbMysql: svconst.DbCommon,
TableName: fmt.Sprintf("%s_%s", tableName, suffix),
}
}
func NewRecordCardAdd(recordBase RecordBase,
cardId int) *RecordCardAdd {
return &RecordCardAdd{
RecordBase: recordBase,
CardId: cardId,
}
}
// RecordRewardAlbum 领取卡组奖励
type RecordRewardAlbum struct {
RecordBase
AlbumId int `gorm:"comment:卡组ID"`
Award string `gorm:"type:varchar(255);comment:奖励内容"`
}
func (d *RecordRewardAlbum) MysqlInfo(suffix string) *svmysql.MysqlInfo {
tableName := svconst.MYSQL_TABLE_S_CARDHOLDER_RECORD_REWARDALBUM
return &svmysql.MysqlInfo{
DbMysql: svconst.DbCommon,
TableName: fmt.Sprintf("%s_%s", tableName, suffix),
}
}
func NewRecordRewardAlbum(recordBase RecordBase,
albumId int, award string) *RecordRewardAlbum {
return &RecordRewardAlbum{
RecordBase: recordBase,
AlbumId: albumId,
Award: award,
}
}
// RecordRewardRound 领取轮次奖励
type RecordRewardRound struct {
RecordBase
Award string `gorm:"type:varchar(255);comment:奖励内容"`
}
func (d *RecordRewardRound) MysqlInfo(suffix string) *svmysql.MysqlInfo {
tableName := svconst.MYSQL_TABLE_S_CARDHOLDER_RECORD_REWARDROUND
return &svmysql.MysqlInfo{
DbMysql: svconst.DbCommon,
TableName: fmt.Sprintf("%s_%s", tableName, suffix),
}
}
func NewRecordRewardRound(recordBase RecordBase,
award string) *RecordRewardRound {
return &RecordRewardRound{
RecordBase: recordBase,
Award: award,
}
}