Lee-WineList/model/entity/user.go
2023-04-27 15:56:12 +08:00

23 lines
1012 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package entity
import (
"Lee-WineList/common/constant"
"Lee-WineList/common/types"
)
// User 普通用户表
type User struct {
types.BaseDbModel
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-禁用'"`
}
func (User) TableName() string {
return "t_user"
}