You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
2.6 KiB
37 lines
2.6 KiB
package model
|
|
|
|
import (
|
|
"pure-admin/global"
|
|
|
|
uuid "github.com/satori/go.uuid"
|
|
)
|
|
|
|
type SysUser struct {
|
|
UUID uuid.UUID `json:"uuid" gorm:"type:varchar(60);comment:用户UUID"` // 用户UUID
|
|
Username string `json:"userName" gorm:"type:varchar(30);comment:用户登录名"` // 用户登录名
|
|
Password string `json:"-" gorm:"type:varchar(60);comment:用户登录密码"` // 用户登录密码
|
|
NickName string `json:"nickName" gorm:"type:varchar(30);default:系统用户;comment:用户昵称"` // 用户昵称
|
|
HeaderImg string `json:"headerImg" gorm:"type:varchar(200);default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像
|
|
FullName string `json:"fullName" gorm:"type:varchar(30);comment:真实姓名"` //
|
|
Phone string `json:"phone" gorm:"type:varchar(15);comment:手机号"` //
|
|
Status string `json:"status" gorm:"type:ENUM('1','0');default:'1';comment:用户状态 1.启用 0.禁用"` // 用户状态
|
|
AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID
|
|
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"` //
|
|
Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;ForeignKey:UUID;JoinForeignKey:SysUserId;References:AuthorityId;JoinReferences:SysAuthorityId"` //
|
|
global.MG_MODEL
|
|
}
|
|
|
|
type SysUserSimple struct {
|
|
Username string `json:"userName"` // 用户登录名
|
|
ID uint `json:"id"`
|
|
UUID uuid.UUID `json:"uuid"`
|
|
NickName string `json:"nickName"`
|
|
}
|
|
|
|
func (SysUserSimple) TableName() string {
|
|
return "user"
|
|
}
|
|
|
|
func (SysUser) TableName() string {
|
|
return "user"
|
|
}
|
|
|