Documentation ¶
Index ¶
- Variables
- func AddRoleForUser(user *User) error
- func ChangeAvatar(ctx iris.Context)
- func CheckingCode(ctx iris.Context)
- func CleanToken(authorityType int, userId string) error
- func Clear(ctx iris.Context)
- func Create(req *Request) (uint, error)
- func CreateNoPassUser(ctx iris.Context)
- func CreateNoPassUuid(req *RequestNpUser) (string, error)
- func CreateUser(ctx iris.Context)
- func CreateUuid(req *RequestUser) (string, error)
- func DelToken(token string) error
- func DeleteUser(ctx iris.Context)
- func GetAccessToken(req *RequestUser) (string, error)
- func GetAll(ctx iris.Context)
- func GetUser(ctx iris.Context)
- func IdScope(id string) func(db *gorm.DB) *gorm.DB
- func IsAdminUser(id uint) error
- func IsNpReg(req *RequestNpUser) (string, error)
- func IsReg(req *RequestUser) (string, error)
- func Logout(ctx iris.Context)
- func MobileScope(mobile string) func(db *gorm.DB) *gorm.DB
- func Party() module.WebModule
- func Profile(ctx iris.Context)
- func PubParty() module.WebModule
- func UpdateAvatar(db *gorm.DB, id uint, avatar string) error
- func UpdateUser(ctx iris.Context)
- func UserNameScope(username string) func(db *gorm.DB) *gorm.DB
- func UserStructLevelValidation(sl validator.StructLevel)
- type Avatar
- type BaseUser
- type CheckCode
- type LoginResponse
- type PageResponse
- type ReqPaginate
- type Request
- type RequestNpUser
- type RequestUser
- type Response
- type User
- func (item *User) Create(db *gorm.DB) (uint, error)
- func (item *User) CreateUuid(db *gorm.DB) (string, error)
- func (item *User) Delete(db *gorm.DB, scopes ...func(db *gorm.DB) *gorm.DB) error
- func (item *User) Update(db *gorm.DB, scopes ...func(db *gorm.DB) *gorm.DB) error
- func (item *User) UpdatePw(db *gorm.DB, scopes ...func(db *gorm.DB) *gorm.DB) error
- type UserNp
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserNameInvalide = errors.New("用户名名称已经被使用")
View Source
var Source = new(source)
Functions ¶
func CreateNoPassUuid ¶
func CreateNoPassUuid(req *RequestNpUser) (string, error)
func CreateUuid ¶
func CreateUuid(req *RequestUser) (string, error)
func IsAdminUser ¶
func IsNpReg ¶
func IsNpReg(req *RequestNpUser) (string, error)
func IsReg ¶
func IsReg(req *RequestUser) (string, error)
func UserNameScope ¶
UserNameScope 根据 username 查询 - username 名称
func UserStructLevelValidation ¶
func UserStructLevelValidation(sl validator.StructLevel)
Types ¶
type BaseUser ¶
type BaseUser struct { Uuid string `gorm:"type:varchar(36);" json:"uuid"` Sex string `gorm:"default:'0';not null; type:tinyint(1)" json:"sex"` Age string `gorm:"default:'0';not null; type:tinyint(2)" json:"age"` Region string `gorm:"not null; type:varchar(15)" json:"region"` Mobile string `gorm:"not null; type:varchar(20)" json:"mobile" validate:"required"` Nickname string `gorm:"not null; type:varchar(60)" json:"nickname"` Name string `gorm:"index;not null; type:varchar(60)" json:"name"` Username string `gorm:"uniqueIndex;not null;type:varchar(60)" json:"username"` Identity string `gorm:"not null; type:varchar(30)" json:"identity"` Intro string `gorm:"not null; type:varchar(512)" json:"intro"` Avatar string `gorm:"type:varchar(1024)" json:"avatar"` }
type LoginResponse ¶
type LoginResponse struct { g.ReqId Password string `json:"password"` Uuid string `gorm:"type:varchar(36);" json:"uuid"` NickName string `gorm:"type:varchar(60)" json:"nickname"` Name string `gorm:"type:varchar(60)" json:"name"` }
func FindPasswordByUserName ¶
type ReqPaginate ¶
type Request ¶
func GetSources ¶
type RequestNpUser ¶
type RequestNpUser struct { BaseUser Code string `json:"code" validate:"required"` RoleIds []uint `json:"role_ids"` }
func (*RequestNpUser) RequestNpUser ¶
func (req *RequestNpUser) RequestNpUser(ctx iris.Context) error
type RequestUser ¶
type RequestUser struct { BaseUser Code string `json:"code" validate:"required"` Password string `json:"password" validate:"required"` RoleIds []uint `json:"role_ids"` }
func (*RequestUser) RequestUser ¶
func (req *RequestUser) RequestUser(ctx iris.Context) error
type User ¶
type User struct { gorm.Model BaseUser Password string `gorm:"type:varchar(250)" json:"password" validate:"required"` RoleIds []uint `gorm:"-" json:"role_ids"` }
type UserNp ¶
func (*UserNp) CreateUuid ¶
CreateUuid 添加
Click to show internal directories.
Click to hide internal directories.