system

package
v0.0.0-...-c9be414 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

type ApiService struct{}

func (ApiService) Add

func (s ApiService) Add(api *system.Api) error

Add 添加资源

func (ApiService) Count

func (s ApiService) Count() (int64, error)

Count 获取数据总数

func (ApiService) Delete

func (s ApiService) Delete(ids []uint) error

Delete 批量删除

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 获取数据总数

func (ApiService) Update

func (s ApiService) Update(api *system.Api) error

Update 更新资源

type GroupService

type GroupService struct{}

func (GroupService) Add

func (s GroupService) Add(data *system.Group) error

Add 添加资源

func (GroupService) AddUserToGroup

func (s GroupService) AddUserToGroup(group *system.Group, users []system.User) error

AddUserToGroup 添加用户到分组

func (GroupService) Count

func (s GroupService) Count() (int64, error)

Count 获取数据总数

func (GroupService) Delete

func (s GroupService) Delete(groups []*system.Group) error

Delete 批量删除

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

func (s GroupService) RemoveUserFromGroup(group *system.Group, users []system.User) error

RemoveUserFromGroup 将用户从分组移除

func (GroupService) Update

func (s GroupService) Update(dataObj *system.Group) error

Update 更新资源

type MenuService struct{}
func (s MenuService) Add(menu *system.Menu) error

Add 创建资源

func (s MenuService) Count() (int64, error)

Count 获取资源总数

func (s MenuService) Delete(menuIds []uint) error

批量删除资源

func (s MenuService) Exist(filter map[string]interface{}) bool

Exist 判断资源是否存在

func (s MenuService) Find(filter map[string]interface{}, data *system.Menu) error

Find 获取单个资源

func (s MenuService) GetUserMenusByUserId(userId uint) ([]*system.Menu, error)

GetUserMenusByUserId 根据用户ID获取用户的权限(可访问)菜单列表

func (s MenuService) List() (menus []*system.Menu, err error)

List 获取数据列表

func (s MenuService) ListUserMenus(roleIds []uint) (menus []*system.Menu, err error)

List 获取数据列表

func (s MenuService) Update(menu *system.Menu) error

Update 更新资源

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

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) Add

func (s RoleService) Add(role *system.Role) error

Add 创建资源

func (RoleService) Count

func (s RoleService) Count() (int64, error)

Count 获取资源总数

func (RoleService) Delete

func (s RoleService) Delete(roleIds []uint) error

Delete 删除资源

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) Update

func (s RoleService) Update(role *system.Role) error

Update 更新资源

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 UserService

type UserService struct{}

func (UserService) Add

func (s UserService) Add(user *system.User) error

Add 添加资源

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) Count

func (s UserService) Count() (int64, error)

Count 获取数据总数

func (UserService) Delete

func (s UserService) Delete(ids []uint) error

Delete 批量删除

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

func (s UserService) GetCurrentLoginUser(c *gin.Context) (system.User, error)

GetCurrentLoginUser 获取当前登录用户信息 需要缓存,减少数据库访问

func (UserService) GetCurrentUserMinRoleSort

func (s UserService) GetCurrentUserMinRoleSort(c *gin.Context) (uint, system.User, error)

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 获取符合条件的数据列表条数

func (UserService) Login

func (s UserService) Login(user *system.User) (*system.User, error)

Login 登录

func (UserService) Update

func (s UserService) Update(user *system.User) error

Update 更新资源

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL