dto-player.go
1.1 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
package roomrank
import (
"apigame/service-common/svconst"
"apigame/service-common/svmysql"
"apigame/util/util-lx/lxtime"
)
// DataRoomRankPlayer 房间排行持久数据
type DataRoomRankPlayer struct {
Uid int64 `gorm:"column:uid;primaryKey;comment:玩家唯一ID"`
ActivityId int64 `gorm:"comment:活动ID"`
UserType int `gorm:"comment:用户类型"` // 0=新手用户 1=优质用户 2=普通用户 3=垃圾用户
UserScore int `gorm:"comment:用户评级分"`
UserClass int `gorm:"comment:用户评级"`
RoomUid int64 `gorm:"comment:所在房间唯一ID"`
CreateTime int64 `gorm:"comment:创建时间戳"`
UpdateTime int64 `gorm:"comment:修改时间戳"`
}
func (d *DataRoomRankPlayer) MysqlInfo(suffix string) *svmysql.MysqlInfo {
tableName := svconst.MYSQL_TABLE_S_ROOMRANK_PLAYER
return &svmysql.MysqlInfo{
DbMysql: svconst.DbCommon,
TableName: tableName + suffix,
}
}
func NewDataRoomRankPlayer(uid int64) *DataRoomRankPlayer {
d := &DataRoomRankPlayer{
Uid: uid,
}
return d
}
func (d *DataRoomRankPlayer) Init(uid int64) {
d.Uid = uid
d.CreateTime = lxtime.NowUninx()
}