Documentation
¶
Index ¶
- type AuthorityRepository
- func (a *AuthorityRepository) AddAuthoritiesByOrganizationId(organizationId string, data []*auth.Operation)
- func (a *AuthorityRepository) AddAuthoritiesByRoleId(roleId string, data []*auth.Operation)
- func (a *AuthorityRepository) AddAuthoritiesByUserId(userId string, data []*auth.Operation)
- func (a *AuthorityRepository) AssginCasbinAuthGroupToOrg(orgId int) (resBool bool)
- func (a *AuthorityRepository) AssginCasbinAuthPolicyToOrg(authPostMountHasMenuButtonId string, nodeType string) (resBool bool)
- func (a *AuthorityRepository) DeleteAuthoritiesByOrganizationId(organizationId string, data []*auth.Operation)
- func (a *AuthorityRepository) DeleteAuthoritiesByRoleId(roleId string, data []*auth.Operation)
- func (a *AuthorityRepository) DeleteAuthoritiesByUserId(userId string, data []*auth.Operation)
- func (a *AuthorityRepository) DeleteCasbibRules(authPostMountHasMenuButtonId string, nodeType string) (resBool bool)
- func (a *AuthorityRepository) DeleteOrganizationAuthorities(organizationId string)
- func (a *AuthorityRepository) DeleteOrganizationAuthoritiesByAuthType(organizationId string, authType string)
- func (a *AuthorityRepository) DeleteOrganizationAuthority(organizationId string, authType string, authId int64)
- func (a *AuthorityRepository) DeleteRoleAuthorities(roleId string)
- func (a *AuthorityRepository) DeleteRoleAuthoritiesByAuthType(roleId string, authType string)
- func (a *AuthorityRepository) DeleteRoleAuthority(roleId string, authType string, authId int64)
- func (a *AuthorityRepository) DeleteUserAuthorities(userId string)
- func (a *AuthorityRepository) DeleteUserAuthoritiesByAuthType(userId string, authType string)
- func (a *AuthorityRepository) DeleteUserAuthority(userId string, authType string, authId int64)
- func (a *AuthorityRepository) GetAuthoritiesByOrganizationId(organizationId string) (count int64, data []*auth.Operation)
- func (a *AuthorityRepository) GetAuthoritiesByOrganizationIds(organizationIds []string) (result []*auth.Operation)
- func (a *AuthorityRepository) GetAuthoritiesByRoleId(roleId string) (counts int64, data []*auth.Operation)
- func (a *AuthorityRepository) GetAuthoritiesByRoleIds(roleIds []string) (result []*auth.Operation)
- func (a *AuthorityRepository) GetAuthoritiesByUserId(userId string) (count int64, data []*auth.Operation)
- func (u *AuthorityRepository) GetButtonListByMenuId(roleIds []string, menuId int64) (r []*auth.Button, err error)
- func (u *AuthorityRepository) GetMenuByRoleIds(roleIds []string) (result []*auth.Menu, err error)
- func (a *AuthorityRepository) GetOrganizationAuthorities(organizationId string) (result []*auth.Operation)
- func (a *AuthorityRepository) GetOrganizationsAuthorities(organizationIds []string) (result []*auth.Operation)
- func (a *AuthorityRepository) GetRoleAuthorities(roleId string) (result []*auth.Operation)
- func (a *AuthorityRepository) GetRolesAuthorities(roleIds []string) (result []*auth.Operation)
- func (a *AuthorityRepository) GetSystemAuthorities() (counts int64, data []*auth.Operation)
- func (a *AuthorityRepository) GetUserAuthorities(userId string) (result []*auth.Operation)
- func (a *AuthorityRepository) SetAuthoritiesByOrganizationId(organizationId string, data []*auth.Operation)
- func (a *AuthorityRepository) SetAuthoritiesByRoleId(roleId string, data []*auth.Operation)
- func (a *AuthorityRepository) SetAuthoritiesByUserId(userId string, data []*auth.Operation)
- type ButtonRepository
- func (b *ButtonRepository) DeleteData(id int64) error
- func (b *ButtonRepository) GetByComponent(component string) ([]*auth.Button, error)
- func (b *ButtonRepository) GetByFid(fid int64) ([]*auth.Button, error)
- func (b *ButtonRepository) GetById(id int64) (*auth.Button, error)
- func (b *ButtonRepository) InsertData(data *auth.Button) (bool, error)
- func (a *ButtonRepository) List(name string, pageable query.Pageable) (counts int64, data []auth.Button)
- func (b *ButtonRepository) Show(keyWords string, pageable query.Pageable) (totalCounts int64, temp []auth.Button)
- func (b *ButtonRepository) UpdateData(data *auth.Button) (bool, error)
- type MenuButtonRepository
- func (a *MenuButtonRepository) BatchDeleteData(ids []struct{ ... }) bool
- func (a *MenuButtonRepository) DeleteData(id int64) bool
- func (a *MenuButtonRepository) GetByButtonId(buttonId int64) bool
- func (a *MenuButtonRepository) GetSystemAuthorities() (int64, []auth.MenuButton)
- func (a *MenuButtonRepository) InsertData(list auth.ButtonArray) bool
- func (a *MenuButtonRepository) InsertMap(data map[string]interface{}) bool
- func (a *MenuButtonRepository) List(sysMenuId int64) (counts int64, data []auth.MenuButton)
- func (a *MenuButtonRepository) MenuButton(menuId int64) (data []auth.MenuButton)
- func (a *MenuButtonRepository) UpdateData(menuEdit auth.MenuEdit) bool
- func (a *MenuButtonRepository) UpdateHook(menuId int64)
- type MenuRepository
- func (a *MenuRepository) CreateMenu(data *auth.Menu) (bool, error)
- func (a *MenuRepository) DeleteData(id int64) (bool, error)
- func (a *MenuRepository) DeleteDataHook(menuId int64)
- func (a *MenuRepository) GetByFid(fid int64) (data []*auth.Menu, err error)
- func (a *MenuRepository) GetById(id int64) (data *auth.Menu, err error)
- func (a *MenuRepository) GetByIds(ids []int64) (result []*auth.Menu)
- func (a *MenuRepository) GetMenuLevel(fid int64) (level int64)
- func (a *MenuRepository) GetSubNodeCount(id int64) (count int64)
- func (a *MenuRepository) List(fid int64, title string, pageable query.Pageable) (counts int64, data []*auth.Menu)
- func (a *MenuRepository) ListWithButtons(fid int64, title string, pageable query.Pageable) (counts int64, data []*auth.Menu)
- func (a *MenuRepository) UpdateMenu(data *auth.Menu) (bool, error)
- type ModuleRepository
- func (a *ModuleRepository) CreateModule(data *auth.Module) (bool, error)
- func (a *ModuleRepository) DeleteData(id int64) (bool, error)
- func (a *ModuleRepository) DeleteTenantModules(tenantId string)
- func (a *ModuleRepository) GetByFid(fid int64) (data []*auth.Module, err error)
- func (a *ModuleRepository) GetById(id int64) (data *auth.Module, err error)
- func (a *ModuleRepository) GetByIds(ids []int64) (result []*auth.Module, err error)
- func (a *ModuleRepository) GetTenantModule(module, tenantId string) (*auth.Module, error)
- func (a *ModuleRepository) GetTenantModules(tenantId string) ([]*auth.Module, error)
- func (a *ModuleRepository) List(fid int64, title string, tenantId string, pageable query.Pageable) (counts int64, data []*auth.Module)
- func (a *ModuleRepository) SetTenantModules(tenantId string, data []*auth.Module)
- func (a *ModuleRepository) UpdateModule(data *auth.Module) (bool, error)
- type RoleMenuRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorityRepository ¶
func (*AuthorityRepository) AddAuthoritiesByOrganizationId ¶ added in v0.0.15
func (a *AuthorityRepository) AddAuthoritiesByOrganizationId(organizationId string, data []*auth.Operation)
func (*AuthorityRepository) AddAuthoritiesByRoleId ¶ added in v0.0.15
func (a *AuthorityRepository) AddAuthoritiesByRoleId(roleId string, data []*auth.Operation)
func (*AuthorityRepository) AddAuthoritiesByUserId ¶ added in v0.0.15
func (a *AuthorityRepository) AddAuthoritiesByUserId(userId string, data []*auth.Operation)
func (*AuthorityRepository) AssginCasbinAuthGroupToOrg ¶
func (a *AuthorityRepository) AssginCasbinAuthGroupToOrg(orgId int) (resBool bool)
给组织机构节点分配casbin的group(角色继承关系权限)
func (*AuthorityRepository) AssginCasbinAuthPolicyToOrg ¶
func (a *AuthorityRepository) AssginCasbinAuthPolicyToOrg(authPostMountHasMenuButtonId string, nodeType string) (resBool bool)
给组织机构节点分配casbin的policy策略权限
func (*AuthorityRepository) DeleteAuthoritiesByOrganizationId ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteAuthoritiesByOrganizationId(organizationId string, data []*auth.Operation)
func (*AuthorityRepository) DeleteAuthoritiesByRoleId ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteAuthoritiesByRoleId(roleId string, data []*auth.Operation)
func (*AuthorityRepository) DeleteAuthoritiesByUserId ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteAuthoritiesByUserId(userId string, data []*auth.Operation)
func (*AuthorityRepository) DeleteCasbibRules ¶
func (a *AuthorityRepository) DeleteCasbibRules(authPostMountHasMenuButtonId string, nodeType string) (resBool bool)
删除 casbin 表接口已分配的权限
func (*AuthorityRepository) DeleteOrganizationAuthorities ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteOrganizationAuthorities(organizationId string)
func (*AuthorityRepository) DeleteOrganizationAuthoritiesByAuthType ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteOrganizationAuthoritiesByAuthType(organizationId string, authType string)
func (*AuthorityRepository) DeleteOrganizationAuthority ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteOrganizationAuthority(organizationId string, authType string, authId int64)
func (*AuthorityRepository) DeleteRoleAuthorities ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteRoleAuthorities(roleId string)
func (*AuthorityRepository) DeleteRoleAuthoritiesByAuthType ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteRoleAuthoritiesByAuthType(roleId string, authType string)
func (*AuthorityRepository) DeleteRoleAuthority ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteRoleAuthority(roleId string, authType string, authId int64)
func (*AuthorityRepository) DeleteUserAuthorities ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteUserAuthorities(userId string)
func (*AuthorityRepository) DeleteUserAuthoritiesByAuthType ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteUserAuthoritiesByAuthType(userId string, authType string)
func (*AuthorityRepository) DeleteUserAuthority ¶ added in v0.0.15
func (a *AuthorityRepository) DeleteUserAuthority(userId string, authType string, authId int64)
func (*AuthorityRepository) GetAuthoritiesByOrganizationId ¶ added in v0.0.15
func (a *AuthorityRepository) GetAuthoritiesByOrganizationId(organizationId string) (count int64, data []*auth.Operation)
根据用户id查询已经分配的菜单
func (*AuthorityRepository) GetAuthoritiesByOrganizationIds ¶ added in v0.0.15
func (a *AuthorityRepository) GetAuthoritiesByOrganizationIds(organizationIds []string) (result []*auth.Operation)
func (*AuthorityRepository) GetAuthoritiesByRoleId ¶ added in v0.0.15
func (a *AuthorityRepository) GetAuthoritiesByRoleId(roleId string) (counts int64, data []*auth.Operation)
已分配给部门、岗位的系统菜单、按钮
func (*AuthorityRepository) GetAuthoritiesByRoleIds ¶ added in v0.0.15
func (a *AuthorityRepository) GetAuthoritiesByRoleIds(roleIds []string) (result []*auth.Operation)
func (*AuthorityRepository) GetAuthoritiesByUserId ¶ added in v0.0.15
func (a *AuthorityRepository) GetAuthoritiesByUserId(userId string) (count int64, data []*auth.Operation)
根据用户id查询已经分配的菜单
func (*AuthorityRepository) GetButtonListByMenuId ¶
func (u *AuthorityRepository) GetButtonListByMenuId(roleIds []string, menuId int64) (r []*auth.Button, err error)
查询用户在指定页面拥有的按钮列表
func (*AuthorityRepository) GetMenuByRoleIds ¶ added in v0.0.17
func (u *AuthorityRepository) GetMenuByRoleIds(roleIds []string) (result []*auth.Menu, err error)
func (*AuthorityRepository) GetOrganizationAuthorities ¶ added in v0.0.15
func (a *AuthorityRepository) GetOrganizationAuthorities(organizationId string) (result []*auth.Operation)
根据用户id查询已经分配的菜单
func (*AuthorityRepository) GetOrganizationsAuthorities ¶ added in v0.0.15
func (a *AuthorityRepository) GetOrganizationsAuthorities(organizationIds []string) (result []*auth.Operation)
func (*AuthorityRepository) GetRoleAuthorities ¶ added in v0.0.15
func (a *AuthorityRepository) GetRoleAuthorities(roleId string) (result []*auth.Operation)
根据用户id查询已经分配的菜单
func (*AuthorityRepository) GetRolesAuthorities ¶ added in v0.0.15
func (a *AuthorityRepository) GetRolesAuthorities(roleIds []string) (result []*auth.Operation)
func (*AuthorityRepository) GetSystemAuthorities ¶ added in v0.0.15
func (a *AuthorityRepository) GetSystemAuthorities() (counts int64, data []*auth.Operation)
GetSystemAuthorities 待分配的系统菜单、按钮 数据列表 注意:按钮的id有可能和主菜单id重复,所以按钮id基准值增加 100000 (10万),后续分配权限时减去 10万即可
func (*AuthorityRepository) GetUserAuthorities ¶
func (a *AuthorityRepository) GetUserAuthorities(userId string) (result []*auth.Operation)
根据用户id查询已经分配的菜单
func (*AuthorityRepository) SetAuthoritiesByOrganizationId ¶ added in v0.0.15
func (a *AuthorityRepository) SetAuthoritiesByOrganizationId(organizationId string, data []*auth.Operation)
给角色分配系统菜单、按钮
func (*AuthorityRepository) SetAuthoritiesByRoleId ¶ added in v0.0.15
func (a *AuthorityRepository) SetAuthoritiesByRoleId(roleId string, data []*auth.Operation)
给角色分配系统菜单、按钮
func (*AuthorityRepository) SetAuthoritiesByUserId ¶ added in v0.0.15
func (a *AuthorityRepository) SetAuthoritiesByUserId(userId string, data []*auth.Operation)
给角色分配系统菜单、按钮
type ButtonRepository ¶
func (*ButtonRepository) GetByComponent ¶ added in v0.0.15
func (b *ButtonRepository) GetByComponent(component string) ([]*auth.Button, error)
func (*ButtonRepository) GetByFid ¶ added in v0.0.15
func (b *ButtonRepository) GetByFid(fid int64) ([]*auth.Button, error)
func (*ButtonRepository) GetById ¶
func (b *ButtonRepository) GetById(id int64) (*auth.Button, error)
func (*ButtonRepository) InsertData ¶
func (b *ButtonRepository) InsertData(data *auth.Button) (bool, error)
新增
func (*ButtonRepository) Show ¶
func (b *ButtonRepository) Show(keyWords string, pageable query.Pageable) (totalCounts int64, temp []auth.Button)
查询(根据关键词模糊查询)
func (*ButtonRepository) UpdateData ¶
func (b *ButtonRepository) UpdateData(data *auth.Button) (bool, error)
更新
type MenuButtonRepository ¶
func (*MenuButtonRepository) BatchDeleteData ¶
func (a *MenuButtonRepository) BatchDeleteData(ids []struct{ menu_id, button_id int64 }) bool
批量删除数据
func (*MenuButtonRepository) DeleteData ¶
func (a *MenuButtonRepository) DeleteData(id int64) bool
删除数据
func (*MenuButtonRepository) GetByButtonId ¶
func (a *MenuButtonRepository) GetByButtonId(buttonId int64) bool
判断按钮是否系统菜单引用
func (*MenuButtonRepository) GetSystemAuthorities ¶
func (a *MenuButtonRepository) GetSystemAuthorities() (int64, []auth.MenuButton)
GetSystemMenuButtonList 待分配的系统菜单、按钮 数据列表 注意:按钮的id有可能和主菜单id重复,所以按钮id基准值增加 100000 (10万),后续分配权限时减去 10万即可
func (*MenuButtonRepository) InsertData ¶
func (a *MenuButtonRepository) InsertData(list auth.ButtonArray) bool
新增
func (*MenuButtonRepository) InsertMap ¶
func (a *MenuButtonRepository) InsertMap(data map[string]interface{}) bool
新增
func (*MenuButtonRepository) List ¶
func (a *MenuButtonRepository) List(sysMenuId int64) (counts int64, data []auth.MenuButton)
查询
func (*MenuButtonRepository) MenuButton ¶
func (a *MenuButtonRepository) MenuButton(menuId int64) (data []auth.MenuButton)
根据菜单ID获取按钮信息
func (*MenuButtonRepository) UpdateData ¶
func (a *MenuButtonRepository) UpdateData(menuEdit auth.MenuEdit) bool
更新
func (*MenuButtonRepository) UpdateHook ¶
func (a *MenuButtonRepository) UpdateHook(menuId int64)
数据更新hook函数,负责更新菜单被引用的地方,同步更新
type MenuRepository ¶
func (*MenuRepository) CreateMenu ¶ added in v0.0.15
func (a *MenuRepository) CreateMenu(data *auth.Menu) (bool, error)
新增
func (*MenuRepository) DeleteData ¶
func (a *MenuRepository) DeleteData(id int64) (bool, error)
删除数据
func (*MenuRepository) DeleteDataHook ¶
func (a *MenuRepository) DeleteDataHook(menuId int64)
菜单主表数据删除,菜单关联的业务数据表同步删除
func (*MenuRepository) GetByFid ¶
func (a *MenuRepository) GetByFid(fid int64) (data []*auth.Menu, err error)
通过fid查询子节点数据
func (*MenuRepository) GetById ¶
func (a *MenuRepository) GetById(id int64) (data *auth.Menu, err error)
通过fid查询子节点数据
func (*MenuRepository) GetByIds ¶
func (a *MenuRepository) GetByIds(ids []int64) (result []*auth.Menu)
根据IDS获取菜单信息
func (*MenuRepository) GetMenuLevel ¶
func (a *MenuRepository) GetMenuLevel(fid int64) (level int64)
获取菜单fid的节点深度
func (*MenuRepository) GetSubNodeCount ¶
func (a *MenuRepository) GetSubNodeCount(id int64) (count int64)
根据id查询是否有子节点数据
func (*MenuRepository) List ¶
func (a *MenuRepository) List(fid int64, title string, pageable query.Pageable) (counts int64, data []*auth.Menu)
查询
func (*MenuRepository) ListWithButtons ¶
func (a *MenuRepository) ListWithButtons(fid int64, title string, pageable query.Pageable) (counts int64, data []*auth.Menu)
查询
func (*MenuRepository) UpdateMenu ¶ added in v0.0.15
func (a *MenuRepository) UpdateMenu(data *auth.Menu) (bool, error)
更新
type ModuleRepository ¶ added in v0.0.21
func (*ModuleRepository) CreateModule ¶ added in v0.0.21
func (a *ModuleRepository) CreateModule(data *auth.Module) (bool, error)
新增
func (*ModuleRepository) DeleteData ¶ added in v0.0.21
func (a *ModuleRepository) DeleteData(id int64) (bool, error)
删除数据
func (*ModuleRepository) DeleteTenantModules ¶ added in v0.0.21
func (a *ModuleRepository) DeleteTenantModules(tenantId string)
func (*ModuleRepository) GetByFid ¶ added in v0.0.21
func (a *ModuleRepository) GetByFid(fid int64) (data []*auth.Module, err error)
通过fid查询子节点数据
func (*ModuleRepository) GetById ¶ added in v0.0.21
func (a *ModuleRepository) GetById(id int64) (data *auth.Module, err error)
通过fid查询子节点数据
func (*ModuleRepository) GetByIds ¶ added in v0.0.21
func (a *ModuleRepository) GetByIds(ids []int64) (result []*auth.Module, err error)
根据IDS获取菜单信息
func (*ModuleRepository) GetTenantModule ¶ added in v0.0.21
func (a *ModuleRepository) GetTenantModule(module, tenantId string) (*auth.Module, error)
func (*ModuleRepository) GetTenantModules ¶ added in v0.0.21
func (a *ModuleRepository) GetTenantModules(tenantId string) ([]*auth.Module, error)
func (*ModuleRepository) List ¶ added in v0.0.21
func (a *ModuleRepository) List(fid int64, title string, tenantId string, pageable query.Pageable) (counts int64, data []*auth.Module)
查询
func (*ModuleRepository) SetTenantModules ¶ added in v0.0.21
func (a *ModuleRepository) SetTenantModules(tenantId string, data []*auth.Module)
给角色分配系统菜单、按钮
func (*ModuleRepository) UpdateModule ¶ added in v0.0.21
func (a *ModuleRepository) UpdateModule(data *auth.Module) (bool, error)
更新
type RoleMenuRepository ¶
func (*RoleMenuRepository) GetByRoleId ¶
func (a *RoleMenuRepository) GetByRoleId(id string) (result []auth.RoleMenu)
根据postID获取菜单ID
func (*RoleMenuRepository) GetByRoleIds ¶
func (a *RoleMenuRepository) GetByRoleIds(ids []string) (result []auth.RoleMenu)
根据id获取菜单id