Documentation
¶
Index ¶
- type User
- func (user *User) ChangePassword(userId int64, fieldMap map[string]interface{})
- func (user *User) Delete(userId int64)
- func (user *User) Detail(userId int64) *User
- func (user *User) Disable(userId int) int64
- func (user *User) Enable(userId int) int64
- func (user *User) GetInfoByName(username string) *User
- func (user *User) IsExistsEmail(email string) int64
- func (user *User) IsExistsUsername(username string) int64
- func (user *User) List(page int, pageSize int, username string) ([]User, int64)
- func (user *User) Save()
- func (user *User) Update(userId int64, fieldMap map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { UserId int64 `json:"userId" gorm:"primary_key; auto_increment; not null"` // 设置字段 userId 自增类型。 Username string `json:"username" gorm:"type:varchar(50); not null; unique"` // 用户名 Password string `json:"-" gorm:"type:char(50); not null "` // 密码,json 返回忽略本字段 Salt string `json:"-" gorm:"type:char(6); not null"` // 密码盐值,json 返回忽略本字段 Email string `json:"email" gorm:"type:varchar(50); not null; unique; default ''"` // 邮箱 IsAdmin int8 `json:"isAdmin" gorm:"tinyint; not null; default 0"` // 是否是管理员 1:管理员 0:普通用户 Status int8 `json:"status" gorm:"tinyint; not null; default 0"` // 1: 正常 0:禁用 CreateTime string `json:"createTime" gorm:"type:varchar(50); not null"` UpdateTime string `json:"updateTime" gorm:"type:varchar(50);"` }
用户model
func (*User) ChangePassword ¶
修改密码
Click to show internal directories.
Click to hide internal directories.