Documentation
¶
Index ¶
- Constants
- func CheckAdmin(id uint64, username string) bool
- func Create(model interface{}) error
- func Delete(id uint64, model interface{}) error
- func Find(id uint64, model interface{}) error
- func PermissionMenuTableComment() (o, c string)
- func PlatformAdminTableComment() (o, c string)
- func PlatformRoleMenuTableComment() (o, c string)
- func PlatformRoleTableComment() (o, c string)
- func Update(id uint64, model interface{}) error
- type IdField
- type Pagination
- type PermissionMenu
- type PlatformAdmin
- type PlatformRole
- type PlatformRoleMenu
- type Query
- type TimeField
Constants ¶
View Source
const ( PAGESIZE = 20 // 每页默认数量 PAGE = 1 // 当前页码 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Pagination ¶
type Pagination struct {
TotalRecord int64 `json:"total_record"`
CurrentPage int `json:"current_page"`
PageSize int `json:"page_size"`
TotalPages int `json:"total_pages"`
HasNext bool `json:"has_next"`
}
分页信息
type PermissionMenu ¶
type PermissionMenu struct {
Id uint64 `gorm:"primaryKey" json:"id" title:"ID"`
AuthProvider string `gorm:"size:50;comment:系统权限认证模块" json:"auth_provider"`
Path string `gorm:"comment:前端路由地址" json:"path"`
Name string `gorm:"comment:菜单名称" json:"name"`
Rules []string `gorm:"type:json;comment:权限api" json:"rules"`
}
type PlatformAdmin ¶
type PlatformAdmin struct {
Id uint64 `gorm:"primaryKey" json:"id" title:"ID" show:"detail,lists"`
RoleId int8 `gorm:"index;comment:用户角色ID" json:"role_id" show:"detail,lists"`
Username string `gorm:"size:20;unique;comment:用户名" json:"username" validate:"required" title:"用户名" show:"detail,lists"`
Password string `gorm:"varchar:150;comment:用户密码" json:"password" validate:"required"`
Status int `gorm:"type:tinyint;comment:是否启用" json:"status" title:"是否启用" show:"detail,lists"`
IsRoot int `gorm:"type:tinyint;comment:是否是超级管理员" json:"is_root" title:"是否是超级管理员" show:"detail,lists"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at" json:"updated_at"`
}
func FindAdmin ¶
func FindAdmin(username string) (*PlatformAdmin, error)
type PlatformRole ¶
type PlatformRole struct {
Id uint64 `gorm:"primaryKey" json:"id" title:"ID"`
Name string `gorm:"size:50;comment:角色名称" json:"username" validate:"required" title:"角色名称"`
Status int `gorm:"type:tinyint;default:1;comment:是否启用" json:"status"`
Listorder int `gorm:"type:tinyint;default:0;comment:是否启用" json:"listorder"`
Menus []string `gorm:"type:json;comment:前端选中权限菜单" json:"menus"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at" json:"updated_at"`
}
type PlatformRoleMenu ¶
Click to show internal directories.
Click to hide internal directories.