🎨 新增用户&完善文章模块
This commit is contained in:
23
model/user/user.go
Normal file
23
model/user/user.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package user
|
||||
|
||||
import "git.echol.cn/loser/lckt/global"
|
||||
|
||||
type User struct {
|
||||
global.GVA_MODEL
|
||||
NickName string `json:"nick_name" gorm:"comment:用户昵称"`
|
||||
Phone string `json:"phone" gorm:"comment:用户手机号"`
|
||||
UnionId string `json:"union_id" gorm:"type:varchar(255) comment '微信UnionId'"`
|
||||
OpenId string `gorm:"column:open_id;default:'';comment:'openId'" json:"-"`
|
||||
Avatar string `json:"avatar" gorm:"comment:用户头像"`
|
||||
Status int8 `gorm:"column:status;default:1;NOT NULL;comment:'用户状态 0 封禁 1 正常'" json:"status"`
|
||||
//邀请码
|
||||
InviteCode *string `json:"invite_code" gorm:"type:varchar(255) comment '用户专属邀请码'"`
|
||||
Balance float32 `json:"balance" gorm:"type:decimal(10,2);comment:学员余额"`
|
||||
CommenderId int `json:"commender_id" gorm:"comment:推荐人ID"`
|
||||
UserLabel string `json:"user_label" gorm:"type:varchar(255) comment '用户标签 普通/VIP/SVIP'"`
|
||||
UserType int8 `gorm:"column:user_type;default:1;NOT NULL;comment:'用户类型 1 用户 2 讲师'" json:"user_type"`
|
||||
}
|
||||
|
||||
func (User) TableName() string {
|
||||
return "app_user"
|
||||
}
|
Reference in New Issue
Block a user