isql

package
v0.5.17 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	User          = &UserService{}
	Group         = &GroupService{}
	Api           = &ApiService{}
	Menu          = &MenuService{}
	Role          = &RoleService{}
	OperationLog  = &OperationLogService{}
	FieldRelation = &FieldRelationService{}
)

Functions

func GenGroupTree

func GenGroupTree(parentId uint, groups []*model.Group) []*model.Group

GenGroupTree 生成分组树

func GenMenuTree

func GenMenuTree(parentId uint, menus []*model.Menu) []*model.Menu

GenMenuTree 生成菜单树

Types

type ApiService

type ApiService struct{}

func (ApiService) Add

func (s ApiService) Add(api *model.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 *model.Api) error

Find 获取单个资源

func (ApiService) GetApisById

func (s ApiService) GetApisById(apiIds []uint) ([]*model.Api, error)

GetApisById 根据接口ID获取接口列表

func (ApiService) List

func (s ApiService) List(req *request.ApiListReq) ([]*model.Api, error)

List 获取数据列表

func (ApiService) ListAll

func (s ApiService) ListAll() (list []*model.Api, err error)

List 获取数据列表

func (ApiService) Update

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

Update 更新资源

type FieldRelationService added in v0.5.0

type FieldRelationService struct{}

func (FieldRelationService) Add added in v0.5.0

func (s FieldRelationService) Add(fieldRelation *model.FieldRelation) error

Add 创建资源

func (FieldRelationService) Count added in v0.5.0

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

Count 获取资源总数

func (FieldRelationService) Delete added in v0.5.0

func (s FieldRelationService) Delete(fieldRelationIds []uint) error

批量删除资源

func (FieldRelationService) Exist added in v0.5.0

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

Exist 判断资源是否存在

func (FieldRelationService) Find added in v0.5.0

func (s FieldRelationService) Find(filter map[string]interface{}, data *model.FieldRelation) error

Find 获取单个资源

func (FieldRelationService) List added in v0.5.0

func (s FieldRelationService) List() (fieldRelations []*model.FieldRelation, err error)

List 获取数据列表

func (FieldRelationService) Update added in v0.5.0

func (s FieldRelationService) Update(fieldRelation *model.FieldRelation) error

Update 更新资源

type GroupService

type GroupService struct{}

func (GroupService) Add

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

Add 添加资源

func (GroupService) AddUserToGroup

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

AddUserToGroup 添加用户到分组

func (GroupService) ChangeSyncState added in v0.5.6

func (s GroupService) ChangeSyncState(id, status int) error

ChangeSyncState 更新分组的同步状态

func (GroupService) Count

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

Count 获取数据总数

func (GroupService) Delete

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

Delete 批量删除

func (GroupService) DeptIdsToGroupIds added in v0.2.0

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 *model.Group, args ...interface{}) error

Find 获取单个资源

func (GroupService) GetGroupByIds

func (s GroupService) GetGroupByIds(ids []uint) (datas []*model.Group, err error)

GetApisById 根据接口ID获取接口列表

func (GroupService) List

func (s GroupService) List(req *request.GroupListReq) ([]*model.Group, error)

List 获取数据列表

func (GroupService) ListAll

func (s GroupService) ListAll() (list []*model.Group, err error)

List 获取数据列表

func (GroupService) ListTree

func (s GroupService) ListTree(req *request.GroupListReq) ([]*model.Group, error)

List 获取数据列表

func (GroupService) RemoveUserFromGroup

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

RemoveUserFromGroup 将用户从分组移除

func (GroupService) Update

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

Update 更新资源

type MenuService struct{}
func (s MenuService) Add(menu *model.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 *model.Menu) error

Find 获取单个资源

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

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

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

List 获取数据列表

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

List 获取数据列表

func (s MenuService) Update(menu *model.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 *model.OperationLog) error

获取单个用户

func (OperationLogService) List

List 获取数据列表

func (OperationLogService) SaveOperationLogChannel

func (s OperationLogService) SaveOperationLogChannel(olc <-chan *model.OperationLog)

var Logs []model.OperationLog //全局变量多个线程需要加锁,所以每个线程自己维护一个 处理OperationLogChan将日志记录到数据库

type RoleService

type RoleService struct{}

func (RoleService) Add

func (s RoleService) Add(role *model.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 *model.Role) error

Find 获取单个资源

func (RoleService) GetRoleMenusById

func (s RoleService) GetRoleMenusById(roleId uint) ([]*model.Menu, error)

GetRoleMenusById 获取角色的权限菜单

func (RoleService) GetRolesByIds

func (s RoleService) GetRolesByIds(roleIds []uint) ([]*model.Role, error)

Delete 根据角色ID获取角色

func (RoleService) List

func (s RoleService) List(req *request.RoleListReq) ([]*model.Role, error)

List 获取数据列表

func (RoleService) Update

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

Update 更新资源

func (RoleService) UpdateRoleApis

func (s RoleService) UpdateRoleApis(roleKeyword string, reqRolePolicies [][]string) error

UpdateRoleApis 更新角色的权限接口(先全部删除再新增)

func (RoleService) UpdateRoleMenus

func (s RoleService) UpdateRoleMenus(role *model.Role) error

UpdateRoleMenus 更新角色的权限菜单

type UserService

type UserService struct{}

func (UserService) Add

func (s UserService) Add(user *model.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) ChangeSyncState added in v0.5.6

func (s UserService) ChangeSyncState(id, status int) error

ChangeSyncState 更新用户的同步状态

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 *model.User) error

Find 获取单个资源

func (UserService) FindTheSameUserName

func (s UserService) FindTheSameUserName(username string, data *model.User) error

Find 获取同名用户已入库的序号最大的用户信息

func (UserService) GetCurrentLoginUser

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

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

func (UserService) GetCurrentUserMinRoleSort

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

GetCurrentUserMinRoleSort 获取当前用户角色排序最小值(最高等级角色)以及当前用户信息

func (UserService) GetUserById

func (us UserService) GetUserById(id uint) (model.User, error)

GetUserById 获取单个用户

func (UserService) GetUserByIds

func (s UserService) GetUserByIds(ids []uint) ([]model.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 *request.UserListReq) ([]*model.User, error)

List 获取数据列表

func (UserService) ListAll

func (s UserService) ListAll() (list []*model.User, err error)

List 获取数据列表

func (UserService) ListCount

func (s UserService) ListCount(req *request.UserListReq) (int64, error)

ListCout 获取符合条件的数据列表条数

func (UserService) Login

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

Login 登录

func (UserService) Update

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

Update 更新资源

Jump to

Keyboard shortcuts

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