dto-game.go
1.05 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"
)
// DataRoomRank 房间排行持久数据
type DataRoomRank 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 int `gorm:"comment:所在房间唯一ID"`
CreateTime int64 `gorm:"comment:创建时间戳"`
UpdateTime int64 `gorm:"comment:修改时间戳"`
}
func (d *DataRoomRank) MysqlInfo(gameId string) *svmysql.MysqlInfo {
tableName := svconst.MYSQL_TABLE_S_ROOMRANK_DATA
return &svmysql.MysqlInfo{
DbMysql: svconst.DbCommon,
TableName: tableName + gameId,
}
}
func NewDataRoomRank(uid int64) *DataRoomRank {
d := &DataRoomRank{
Uid: uid,
}
return d
}
func (d *DataRoomRank) Init(uid int64) {
d.Uid = uid
d.CreateTime = lxtime.NowUninx()
}