2023-04-24 17:19:41 +08:00
|
|
|
|
package entity
|
|
|
|
|
|
|
|
|
|
import (
|
2023-04-27 15:56:12 +08:00
|
|
|
|
"Lee-WineList/common/constant"
|
2023-04-24 17:19:41 +08:00
|
|
|
|
"Lee-WineList/common/types"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// User 普通用户表
|
|
|
|
|
type User struct {
|
|
|
|
|
types.BaseDbModel
|
2023-04-27 15:56:12 +08:00
|
|
|
|
Phone string `json:"phone" gorm:"index:deleted,unique;type:varchar(255) not null comment '手机号'"`
|
|
|
|
|
WechatUnionId *string `json:"wechat_union_id" gorm:"type:varchar(255) comment '微信UnionId'"`
|
|
|
|
|
WechatOpenId *string `json:"wechat_open_id" gorm:"type:varchar(255) comment '微信OpenId'"`
|
|
|
|
|
Nickname string `json:"nickname" gorm:"type:varchar(255) comment '昵称'"`
|
|
|
|
|
Avatar string `json:"avatar" gorm:"type:varchar(255) comment '头像'"`
|
|
|
|
|
Sex constant.UserSex `json:"sex" gorm:"type:int; default 0; not null comment 性别"` // 1男2女
|
|
|
|
|
Status constant.UserStatus `json:"status" gorm:"type:enum('NORMAL','DISABLE'); default:'NORMAL'; not null; comment:'状态 NORMAL-正常;DISABLE-禁用'"`
|
2023-04-24 17:19:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (User) TableName() string {
|
|
|
|
|
return "t_user"
|
|
|
|
|
}
|