Documentation ¶
Index ¶
- Variables
- func AddRoleForUser(user *User) error
- func ChangeAvatar(ctx iris.Context)
- func CleanToken(authorityType int, userId string) error
- func Clear(ctx iris.Context)
- func Create(req *Request) (uint, error)
- func CreateUser(ctx iris.Context)
- func DelToken(token string) error
- func DeleteUser(ctx iris.Context)
- func GetAll(ctx iris.Context)
- func GetMigration() *gormigrate.Migration
- func GetUser(ctx iris.Context)
- func IsAdminUser(id uint) error
- func Logout(ctx iris.Context)
- func Party() func(index iris.Party)
- func Profile(ctx iris.Context)
- 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
- type Avatar
- type BaseUser
- type LoginResponse
- type PageResponse
- type ReqPaginate
- type Request
- type Response
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserNameInvalide = errors.New("用户名名称已经被使用")
View Source
var Source = new(source)
Functions ¶
func GetMigration ¶
func GetMigration() *gormigrate.Migration
func IsAdminUser ¶
Types ¶
type BaseUser ¶
type BaseUser struct { Name string `gorm:"index;not null; type:varchar(60)" json:"name"` Username string `gorm:"uniqueIndex;not null;type:varchar(60)" json:"username" validate:"required"` Intro string `gorm:"not null; type:varchar(512)" json:"intro"` Avatar string `gorm:"type:varchar(1024)" json:"avatar"` }
type LoginResponse ¶
type PageResponse ¶
type PageResponse struct {
Item []*Response
}
Paginate 分页
type ReqPaginate ¶
type Request ¶
type Request struct { BaseUser Password string `json:"password"` RoleNames []string `json:"role_ids"` }
func GetSources ¶
Click to show internal directories.
Click to hide internal directories.