game/common/model/user/user.go
2025-06-07 22:53:54 +08:00

25 lines
740 B
Go

package user
// 玩家账户表
type User struct {
ID int64 `gorm:"primarykey;autoIncrement" json:"id"`
AccountId int64 `gorm:"uniqueIndex;not null" json:"account_id"` // 帐号id
Nickname string `gorm:"type:varchar(32);uniqueIndex;not null" json:"nickname"` // 昵称
AvatarUrl string `gorm:"type:varchar(255)" json:"avatar_url"` // 头像
AvatarFrame string `gorm:"type:varchar(255)" json:"avatar_frame"` // 头像框
VipExp int32 `gorm:"type:int" json:"vip_exp"` // vip经验值
}
func (u User) GetId() int64 {
return u.ID
}
func (u User) TableName() string {
return "user"
}
type GameUser struct {
User
UserResources
}