Documentation ¶
Index ¶
- func AccountInfo(ctx *gin.Context)
- func GroupAdd(ctx *gin.Context)
- func GroupDelete(ctx *gin.Context)
- func GroupList(ctx *gin.Context)
- func GroupMsg(ctx *gin.Context)
- func GroupOptions(ctx *gin.Context)
- func GroupPermUpdate(ctx *gin.Context)
- func GroupPermission(ctx *gin.Context)
- func GroupUpdate(ctx *gin.Context)
- func GroupUserCas(ctx *gin.Context)
- func InitRoute(engine *gin.Engine)
- func InitTable(ctx *gin.Context)
- func PermissionAdd(ctx *gin.Context)
- func PermissionDelete(ctx *gin.Context)
- func PermissionList(ctx *gin.Context)
- func PermissionMsg(ctx *gin.Context)
- func PermissionUpdate(ctx *gin.Context)
- func UserAdd(ctx *gin.Context)
- func UserDelete(ctx *gin.Context)
- func UserList(ctx *gin.Context)
- func UserLogin(ctx *gin.Context)
- func UserLogout(ctx *gin.Context)
- func UserMsg(ctx *gin.Context)
- func UserOptions(ctx *gin.Context)
- func UserUpdate(ctx *gin.Context)
- type AccountMsg
- type GroupInfSim
- type GroupInfo
- type GroupPermMap
- type GroupPostForm
- type Permission
- type PermissionInfo
- type SystemGroup
- type User
- type UserGroupMap
- type UserInfo
- type UserMsgSim
- type UserPostForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserOptions ¶
UserOptions 获取用户组信息 --OK(获取所有用户的信息,然后取其中的中文名字和英文名字)
Types ¶
type AccountMsg ¶
type AccountMsg struct { Name string `json:"name"` NickName string `json:"nick_name"` Roles []string `json:"roles"` Perms []string `json:"perms"` Avatar string `json:"avatar"` }
AccountMsg 账号信息
type GroupInfSim ¶
type GroupInfSim struct { ID uint `json:"id"` GroupName string `json:"group_name"` NickName string `json:"nick_name"` }
GroupInfSim 简单用户组信息
type GroupInfo ¶
type GroupInfo struct { ID uint `json:"id"` GroupName string `json:"group_name"` NickName string `json:"nick_name"` CreatedAt string `json:"create_time"` }
GroupInfo 用户信息返回
type GroupPermMap ¶
type GroupPermMap struct { PermissionID uint `gorm:"type:int(10);not null;column:permission_id"` GroupID uint `gorm:"type:int(10);not null;column:system_group_id"` }
GroupPermMap 用户组权限表关联
func (GroupPermMap) TableName ¶
func (GroupPermMap) TableName() string
TableName GroupPermMap 权限中间表表名
type GroupPostForm ¶
type GroupPostForm struct { GroupName string `json:"group_name"` NickName string `json:"nick_name"` UserIds []uint `json:"user_selected"` }
GroupPostForm 接收请求POST数据结构体
type Permission ¶
type Permission struct { Name string `gorm:"type:varchar(32);unique;not null;column:name"` NickName string `gorm:"type:varchar(32);unique;not null;column:nick_name"` Type string `gorm:"type:varchar(32);not null;column:type"` SystemGroups []SystemGroup `gorm:"many2many:group_permission"` gorm.Model }
Permission 用户权限
type PermissionInfo ¶
type PermissionInfo struct { ID uint `json:"id"` Name string `json:"name"` NickName string `json:"nick_name"` Type string `json:"type"` }
PermissionInfo 用户权限
type SystemGroup ¶
type SystemGroup struct { // ID int `gorm:"type:int;primary_key;column:id;AUTO_INCREMENT"` GroupName string `gorm:"type:varchar(32);unique;not null;column:group_name"` NickName string `gorm:"type:varchar(32);not null;column:nick_name"` Users []User `gorm:"many2many:user_group"` Permissions []Permission `gorm:"many2many:group_permission"` gorm.Model }
SystemGroup 用户组表结构体
type User ¶
type User struct { // ID int `gorm:"type:int(10);primary_key;column:id;AUTO_INCREMENT;"` UserName string `gorm:"type:varchar(32);unique;not null;column:username"` NickName string `gorm:"type:varchar(32);unique;not null;column:nick_name"` Password string `gorm:"type:varchar(64);column:password"` Email string `gorm:"type:varchar(64);column:email"` Phone string `gorm:"type:varchar(16);column:phone"` SystemGroups []SystemGroup `gorm:"many2many:user_group"` gorm.Model }
User 用户表结构体
type UserGroupMap ¶
type UserGroupMap struct { UserID uint `gorm:"type:int(10);not null;column:user_id"` GroupID uint `gorm:"type:int(10);not null;column:system_group_id"` }
UserGroupMap 用户组与用户关系中间表结构体
type UserInfo ¶
type UserInfo struct { ID uint `json:"id"` UserName string `json:"username"` NickName string `json:"nick_name"` Email string `json:"email"` Phone string `json:"phone"` Groups []GroupInfSim `json:"groups"` CreatedAt string `json:"create_time"` }
UserInfo 用户信息返回
type UserMsgSim ¶
type UserMsgSim struct { ID int `json:"id"` UserName string `json:"username"` NickName string `json:"nick_name"` }
UserMsgSim 用户信息
Click to show internal directories.
Click to hide internal directories.