Documentation ¶
Index ¶
- Variables
- type Privilege
- func (p *Privilege) Delete(privilegeId string) (err error)
- func (p *Privilege) GetPrivilegeByPrivilegeId(privilegeId string) (privilege map[string]string, err error)
- func (p *Privilege) GetTypedPrivileges(userId string, isDisplay string) (navigators, menus, controllers []map[string]string, err error)
- func (p *Privilege) HasSub(privilegeId string) (has bool, err error)
- func (p *Privilege) Insert(privilege map[string]interface{}) (id int64, err error)
- func (p *Privilege) Update(privilegeId string, privilege map[string]interface{}) (id int64, err error)
- type Role
- func (p *Role) Delete(roleId string) (err error)
- func (this *Role) GetAllRoles() (roles []map[string]string, err error)
- func (p *Role) GetRoleByRoleId(roleId string) (role map[string]string, err error)
- func (this *Role) GetRolesByUserId(userId string) (roles []map[string]string, err error)
- func (p *Role) HasUser(roleId string) (has bool, err error)
- func (p *Role) Insert(role map[string]interface{}) (id int64, err error)
- func (p *Role) Update(roleId string, role map[string]interface{}) (id int64, err error)
- type RolePrivilege
- type User
- func (p *User) ChangePassword(userId, newpassword, oldpassword string) (err error)
- func (user *User) CountUsers() (count int, err error)
- func (user *User) CountUsersByKeyword(keyword string) (count int, err error)
- func (p *User) EncodePassword(password string) (passwordHash string)
- func (p *User) Forbidden(userId string) (err error)
- func (p *User) GetUserByName(username string) (user map[string]string, err error)
- func (p *User) GetUserByUserId(userId string) (user map[string]string, err error)
- func (user *User) GetUsersByKeywordAndLimit(keyword string, limit int, number int) (users []map[string]string, err error)
- func (user *User) GetUsersByLimit(limit int, number int) (users []map[string]string, err error)
- func (p *User) HasSameUsername(userId, username string) (has bool, err error)
- func (p *User) HasUsername(username string) (has bool, err error)
- func (p *User) Insert(user map[string]interface{}) (id int64, err error)
- func (p *User) Review(userId string) (err error)
- func (p *User) Update(userId string, user map[string]interface{}) (id int64, err error)
- type UserRole
Constants ¶
This section is empty.
Variables ¶
View Source
var G *mysql.DBGroup
Functions ¶
This section is empty.
Types ¶
type Privilege ¶
type Privilege struct { }
func (*Privilege) GetPrivilegeByPrivilegeId ¶
func (*Privilege) GetTypedPrivileges ¶
type Role ¶
type Role struct { }
func (*Role) GetAllRoles ¶
获取所有的角色
func (*Role) GetRoleByRoleId ¶
func (*Role) GetRolesByUserId ¶
根据用户名查找所有的角色
type RolePrivilege ¶
type RolePrivilege struct { RolePrivilegeID uint `orm:"pk"` // role_privilege_id RoleID uint // role_id PrivilegeID uint // privilege_id IsDelete int8 // is_delete CreateTime uint // create_time UpdateTime uint // update_time }
func (*RolePrivilege) GetRolePrivilegesByRoleId ¶
func (rolePrivilege *RolePrivilege) GetRolePrivilegesByRoleId(roleId int) (rolePrivileges []map[string]string, err error)
根据 role_id 获取权限
func (*RolePrivilege) GrantRolePrivileges ¶
func (rolePrivilege *RolePrivilege) GrantRolePrivileges(roleId int, privilegeIds []string) (res bool, err error)
角色授权
type User ¶
type User struct { }
func (*User) ChangePassword ¶
func (*User) CountUsers ¶
func (*User) CountUsersByKeyword ¶
func (*User) EncodePassword ¶
func (*User) GetUserByName ¶
func (*User) GetUserByUserId ¶
func (*User) GetUsersByKeywordAndLimit ¶
func (user *User) GetUsersByKeywordAndLimit(keyword string, limit int, number int) (users []map[string]string, err error)
根据关键字分页获取用户
func (*User) GetUsersByLimit ¶
分页获取用户
func (*User) HasSameUsername ¶
Click to show internal directories.
Click to hide internal directories.