feat: user & article: dev complete
This commit is contained in:
@@ -3,13 +3,43 @@ package models
|
||||
import "time"
|
||||
|
||||
type BackUser struct {
|
||||
ID int `gorm:"primaryKey;column:id" json:"-"` // 用户ID
|
||||
Username string `gorm:"column:username" json:"username"` // 用户真实姓名
|
||||
Password string `gorm:"column:password" json:"password"` // 用户密码
|
||||
Role int `gorm:"column:role" json:"role"` // 用户角色
|
||||
Email string `gorm:"unique;column:email" json:"email"` // 用户邮箱
|
||||
Phone string `gorm:"unique;column:phone" json:"phone"` // 用户手机号码
|
||||
Aptitude string `gorm:"column:aptitude" json:"aptitude"` // 用户资质证明(图片URL)
|
||||
RegisterTime time.Time `gorm:"column:register_time" json:"registerTime"` // 用户注册时间
|
||||
Approver int `gorm:"column:approver" json:"approver"` // 注册审核人ID
|
||||
ID int `gorm:"primaryKey;column:id" json:"-"` // 用户ID
|
||||
Username string `gorm:"column:username" json:"username"` // 用户真实姓名
|
||||
Password string `gorm:"column:password" json:"password"` // 用户密码
|
||||
Role int `gorm:"column:role" json:"role"` // 用户角色
|
||||
Email string `gorm:"column:email" json:"email"` // 用户邮箱
|
||||
Phone string `gorm:"column:phone" json:"phone"` // 用户手机号码
|
||||
Aptitude string `gorm:"column:aptitude" json:"aptitude"` // 用户资质证明(图片URL)
|
||||
CreateTime time.Time `gorm:"column:create_time" json:"createTime"` // 用户注册时间
|
||||
Approver int `gorm:"column:approver" json:"approver"` // 注册审核人ID
|
||||
ModifyTime time.Time `gorm:"column:modify_time" json:"modifyTime"`
|
||||
IsDelete int8 `gorm:"column:is_delete" json:"isDelete"` // 删除标志
|
||||
}
|
||||
|
||||
type UserLogin struct {
|
||||
Account string `json:"account"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type UserRegister struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
Aptitude string `json:"aptitude"`
|
||||
}
|
||||
|
||||
type UserChangePwd struct {
|
||||
Email string `json:"email"`
|
||||
Code string `json:"code"`
|
||||
NewPassword string `json:"newPassword"`
|
||||
}
|
||||
|
||||
type UserApprove struct {
|
||||
Email string `json:"email"`
|
||||
Pass bool `json:"pass"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
initJcMap[BackUser]()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user