Documentation ¶
Index ¶
- type ApiService
- func (s ApiService) Add(api *system.Api) error
- func (s ApiService) Count() (int64, error)
- func (s ApiService) Delete(ids []uint) error
- func (s ApiService) Exist(filter map[string]interface{}) bool
- func (s ApiService) Find(filter map[string]interface{}, data *system.Api) error
- func (s ApiService) GetApisById(apiIds []uint) ([]*system.Api, error)
- func (s ApiService) List(req *systemReq.ApiListReq) ([]*system.Api, error)
- func (s ApiService) ListAll() (list []*system.Api, err error)
- func (s ApiService) ListCount(req *systemReq.ApiListReq) (int64, error)
- func (s ApiService) Update(api *system.Api) error
- type GroupService
- func (s GroupService) Add(data *system.Group) error
- func (s GroupService) AddUserToGroup(group *system.Group, users []system.User) error
- func (s GroupService) Count() (int64, error)
- func (s GroupService) Delete(groups []*system.Group) error
- func (s GroupService) DeptIdsToGroupIds(ids []string) (groupIds []uint, err error)
- func (s GroupService) Exist(filter map[string]interface{}) bool
- func (s GroupService) Find(filter map[string]interface{}, data *system.Group, args ...interface{}) error
- func (s GroupService) GetGroupByIds(ids []uint) (datas []*system.Group, err error)
- func (s GroupService) List(req *systemReq.GroupListReq) ([]*system.Group, error)
- func (s GroupService) ListAll(req *systemReq.GroupListAllReq) ([]*system.Group, error)
- func (s GroupService) ListCount(req *systemReq.GroupListReq) (int64, error)
- func (s GroupService) ListTree(req *systemReq.GroupListReq) ([]*system.Group, error)
- func (s GroupService) RemoveUserFromGroup(group *system.Group, users []system.User) error
- func (s GroupService) Update(dataObj *system.Group) error
- type MenuService
- func (s MenuService) Add(menu *system.Menu) error
- func (s MenuService) Count() (int64, error)
- func (s MenuService) Delete(menuIds []uint) error
- func (s MenuService) Exist(filter map[string]interface{}) bool
- func (s MenuService) Find(filter map[string]interface{}, data *system.Menu) error
- func (s MenuService) GetUserMenusByUserId(userId uint) ([]*system.Menu, error)
- func (s MenuService) List() (menus []*system.Menu, err error)
- func (s MenuService) ListUserMenus(roleIds []uint) (menus []*system.Menu, err error)
- func (s MenuService) Update(menu *system.Menu) error
- type OperationLogService
- func (s OperationLogService) Count() (count int64, err error)
- func (s OperationLogService) Delete(operationLogIds []uint) error
- func (s OperationLogService) Exist(filter map[string]interface{}) bool
- func (s OperationLogService) Find(filter map[string]interface{}, data *system.OperationLog) error
- func (s OperationLogService) List(req *systemReq.OperationLogListReq) ([]*system.OperationLog, error)
- func (s OperationLogService) ListCount(req *systemReq.OperationLogListReq) (count int64, err error)
- func (s OperationLogService) SaveOperationLogChannel(olc <-chan *system.OperationLog)
- type RoleService
- func (s RoleService) Add(role *system.Role) error
- func (s RoleService) Count() (int64, error)
- func (s RoleService) Delete(roleIds []uint) error
- func (s RoleService) Exist(filter map[string]interface{}) bool
- func (s RoleService) Find(filter map[string]interface{}, data *system.Role) error
- func (s RoleService) GetRoleMenusById(roleId uint) ([]*system.Menu, error)
- func (s RoleService) GetRolesByIds(roleIds []uint) ([]*system.Role, error)
- func (s RoleService) List(req *systemReq.RoleListReq) ([]*system.Role, error)
- func (s RoleService) ListCount(req *systemReq.RoleListReq) (int64, error)
- func (s RoleService) Update(role *system.Role) error
- func (s RoleService) UpdateRoleApis(roleKeyword string, reqRolePolicies [][]string) error
- func (s RoleService) UpdateRoleMenus(role *system.Role) error
- type ServiceGroup
- type UserService
- func (s UserService) Add(user *system.User) error
- func (s UserService) ChangePwd(username string, hashNewPasswd string) error
- func (s UserService) ChangeStatus(id, status int) error
- func (s UserService) ClearUserInfoCache()
- func (s UserService) Count() (int64, error)
- func (s UserService) Delete(ids []uint) error
- func (s UserService) Exist(filter map[string]interface{}) bool
- func (s UserService) Find(filter map[string]interface{}, data *system.User) error
- func (s UserService) FindTheSameUserName(username string, data *system.User) error
- func (s UserService) GetCurrentLoginUser(c *gin.Context) (system.User, error)
- func (s UserService) GetCurrentUserMinRoleSort(c *gin.Context) (uint, system.User, error)
- func (us UserService) GetUserById(id uint) (system.User, error)
- func (s UserService) GetUserByIds(ids []uint) ([]system.User, error)
- func (s UserService) GetUserMinRoleSortsByIds(ids []uint) ([]int, error)
- func (s UserService) List(req *systemReq.UserListReq) ([]*system.User, error)
- func (s UserService) ListAll() (list []*system.User, err error)
- func (s UserService) ListCount(req *systemReq.UserListReq) (int64, error)
- func (s UserService) Login(user *system.User) (*system.User, error)
- func (s UserService) Update(user *system.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiService ¶
type ApiService struct{}
func (ApiService) Exist ¶
func (s ApiService) Exist(filter map[string]interface{}) bool
Exist 判断资源是否存在
func (ApiService) Find ¶
func (s ApiService) Find(filter map[string]interface{}, data *system.Api) error
Find 获取单个资源
func (ApiService) GetApisById ¶
func (s ApiService) GetApisById(apiIds []uint) ([]*system.Api, error)
GetApisById 根据接口ID获取接口列表
func (ApiService) List ¶
func (s ApiService) List(req *systemReq.ApiListReq) ([]*system.Api, error)
List 获取数据列表
func (ApiService) ListAll ¶
func (s ApiService) ListAll() (list []*system.Api, err error)
List 获取数据列表
func (ApiService) ListCount ¶
func (s ApiService) ListCount(req *systemReq.ApiListReq) (int64, error)
ListCount 获取数据总数
type GroupService ¶
type GroupService struct{}
func (GroupService) AddUserToGroup ¶
AddUserToGroup 添加用户到分组
func (GroupService) DeptIdsToGroupIds ¶
func (s GroupService) DeptIdsToGroupIds(ids []string) (groupIds []uint, err error)
DeptIdsToGroupIds 将企业IM部门id转换为MySQL分组id
func (GroupService) Exist ¶
func (s GroupService) Exist(filter map[string]interface{}) bool
Exist 判断资源是否存在
func (GroupService) Find ¶
func (s GroupService) Find(filter map[string]interface{}, data *system.Group, args ...interface{}) error
Find 获取单个资源
func (GroupService) GetGroupByIds ¶
func (s GroupService) GetGroupByIds(ids []uint) (datas []*system.Group, err error)
GetApisById 根据接口ID获取接口列表
func (GroupService) List ¶
func (s GroupService) List(req *systemReq.GroupListReq) ([]*system.Group, error)
List 获取数据列表
func (GroupService) ListAll ¶
func (s GroupService) ListAll(req *systemReq.GroupListAllReq) ([]*system.Group, error)
List 获取数据列表
func (GroupService) ListCount ¶
func (s GroupService) ListCount(req *systemReq.GroupListReq) (int64, error)
ListCount 获取附和条件的数据总数
func (GroupService) ListTree ¶
func (s GroupService) ListTree(req *systemReq.GroupListReq) ([]*system.Group, error)
List 获取数据列表
func (GroupService) RemoveUserFromGroup ¶
RemoveUserFromGroup 将用户从分组移除
type MenuService ¶
type MenuService struct{}
func (MenuService) Exist ¶
func (s MenuService) Exist(filter map[string]interface{}) bool
Exist 判断资源是否存在
func (MenuService) Find ¶
func (s MenuService) Find(filter map[string]interface{}, data *system.Menu) error
Find 获取单个资源
func (MenuService) GetUserMenusByUserId ¶
func (s MenuService) GetUserMenusByUserId(userId uint) ([]*system.Menu, error)
GetUserMenusByUserId 根据用户ID获取用户的权限(可访问)菜单列表
func (MenuService) ListUserMenus ¶
func (s MenuService) ListUserMenus(roleIds []uint) (menus []*system.Menu, err error)
List 获取数据列表
type OperationLogService ¶
type OperationLogService struct{}
func (OperationLogService) Count ¶
func (s OperationLogService) Count() (count int64, err error)
Count 获取数据总数
func (OperationLogService) Delete ¶
func (s OperationLogService) Delete(operationLogIds []uint) error
Delete 删除资源
func (OperationLogService) Exist ¶
func (s OperationLogService) Exist(filter map[string]interface{}) bool
Exist 判断资源是否存在
func (OperationLogService) Find ¶
func (s OperationLogService) Find(filter map[string]interface{}, data *system.OperationLog) error
获取单个用户
func (OperationLogService) List ¶
func (s OperationLogService) List(req *systemReq.OperationLogListReq) ([]*system.OperationLog, error)
List 获取数据列表
func (OperationLogService) ListCount ¶
func (s OperationLogService) ListCount(req *systemReq.OperationLogListReq) (count int64, err error)
ListCount 获取符合条件的数据总数
func (OperationLogService) SaveOperationLogChannel ¶
func (s OperationLogService) SaveOperationLogChannel(olc <-chan *system.OperationLog)
var Logs []system.OperationLog //全局变量多个线程需要加锁,所以每个线程自己维护一个 处理OperationLogChan将日志记录到数据库
type RoleService ¶
type RoleService struct{}
func (RoleService) Exist ¶
func (s RoleService) Exist(filter map[string]interface{}) bool
Exist 判断资源是否存在
func (RoleService) Find ¶
func (s RoleService) Find(filter map[string]interface{}, data *system.Role) error
Find 获取单个资源
func (RoleService) GetRoleMenusById ¶
func (s RoleService) GetRoleMenusById(roleId uint) ([]*system.Menu, error)
GetRoleMenusById 获取角色的权限菜单
func (RoleService) GetRolesByIds ¶
func (s RoleService) GetRolesByIds(roleIds []uint) ([]*system.Role, error)
Delete 根据角色ID获取角色
func (RoleService) List ¶
func (s RoleService) List(req *systemReq.RoleListReq) ([]*system.Role, error)
List 获取数据列表
func (RoleService) ListCount ¶
func (s RoleService) ListCount(req *systemReq.RoleListReq) (int64, error)
ListCount 获取符合条件的资源总数
func (RoleService) UpdateRoleApis ¶
func (s RoleService) UpdateRoleApis(roleKeyword string, reqRolePolicies [][]string) error
UpdateRoleApis 更新角色的权限接口(先全部删除再新增)
func (RoleService) UpdateRoleMenus ¶
func (s RoleService) UpdateRoleMenus(role *system.Role) error
UpdateRoleMenus 更新角色的权限菜单
type ServiceGroup ¶
type ServiceGroup struct { ApiService GroupService MenuService OperationLogService RoleService UserService }
type UserService ¶
type UserService struct{}
func (UserService) ChangePwd ¶
func (s UserService) ChangePwd(username string, hashNewPasswd string) error
ChangePwd 更新密码
func (UserService) ChangeStatus ¶
func (s UserService) ChangeStatus(id, status int) error
ChangeStatus 更新状态
func (UserService) ClearUserInfoCache ¶
func (s UserService) ClearUserInfoCache()
ClearUserInfoCache 清理所有用户信息缓存
func (UserService) Exist ¶
func (s UserService) Exist(filter map[string]interface{}) bool
Exist 判断资源是否存在
func (UserService) Find ¶
func (s UserService) Find(filter map[string]interface{}, data *system.User) error
Find 获取单个资源
func (UserService) FindTheSameUserName ¶
func (s UserService) FindTheSameUserName(username string, data *system.User) error
Find 获取同名用户已入库的序号最大的用户信息
func (UserService) GetCurrentLoginUser ¶
GetCurrentLoginUser 获取当前登录用户信息 需要缓存,减少数据库访问
func (UserService) GetCurrentUserMinRoleSort ¶
GetCurrentUserMinRoleSort 获取当前用户角色排序最小值(最高等级角色)以及当前用户信息
func (UserService) GetUserById ¶
func (us UserService) GetUserById(id uint) (system.User, error)
GetUserById 获取单个用户
func (UserService) GetUserByIds ¶
func (s UserService) GetUserByIds(ids []uint) ([]system.User, error)
GetUserByIds 根据用户ID获取用户角色排序最小值
func (UserService) GetUserMinRoleSortsByIds ¶
func (s UserService) GetUserMinRoleSortsByIds(ids []uint) ([]int, error)
GetUserMinRoleSortsByIds 根据用户ID获取用户角色排序最小值
func (UserService) List ¶
func (s UserService) List(req *systemReq.UserListReq) ([]*system.User, error)
List 获取数据列表
func (UserService) ListAll ¶
func (s UserService) ListAll() (list []*system.User, err error)
List 获取数据列表
func (UserService) ListCount ¶
func (s UserService) ListCount(req *systemReq.UserListReq) (int64, error)
ListCout 获取符合条件的数据列表条数