24 lines
623 B
Go
24 lines
623 B
Go
package model
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// 玩家账户表
|
|
type User struct {
|
|
gorm.Model
|
|
Nickname string `gorm:"type:varchar(32);uniqueIndex;not null"` // 用户名
|
|
AvatarUrl string `gorm:"type:varchar(255)"` // 头像
|
|
AvatarBorder string `gorm:"type:varchar(255)"` // 头像框
|
|
Gold int64 `gorm:"type:bigint;default:0"` // 金币
|
|
VipExp int32 `gorm:"type:int"` // vip经验值
|
|
}
|
|
|
|
func (u User) GetId() uint {
|
|
return u.ID
|
|
}
|
|
|
|
func NewUserOp() *TableOp[User] {
|
|
return newTableOp[User](UserDB, UserRedis)
|
|
}
|