Documentation ¶
Index ¶
- type AuthorityRepository
- func (a *AuthorityRepository) AssginAuthForOrg(orgId, menuId, buttonId int64, nodeType string) (assignRes bool)
- func (a *AuthorityRepository) AssginCasbinAuthGroupToOrg(orgId int) (resBool bool)
- func (a *AuthorityRepository) AssginCasbinAuthPolicyToOrg(authPostMountHasMenuButtonId string, nodeType string) (resBool bool)
- func (a *AuthorityRepository) DeleteAuthFromOrg(roleId, menuId, buttonId int, nodeType string) bool
- func (a *AuthorityRepository) DeleteCasbibRules(authPostMountHasMenuButtonId string, nodeType string) (resBool bool)
- func (a *AuthorityRepository) GetAssignedMenuButtonList(roleId string) (counts int64, data []auth.AuthNode)
- func (u *AuthorityRepository) GetButtonListByMenuId(roleIds []string, MenuId int64) (r []auth.Button)
- func (a *AuthorityRepository) GetSystemMenuButtonList() (counts int64, data []auth.AuthNode)
- func (a *AuthorityRepository) GetUserAuthorities(userId string) (result []auth.AuthNode)
- type ButtonRepository
- func (b *ButtonRepository) DeleteData(id int64) error
- func (b *ButtonRepository) GetById(id int64) (*auth.Button, error)
- func (b *ButtonRepository) InsertData(data *auth.Button) (bool, error)
- func (a *ButtonRepository) List(cnName 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) 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) (nodeLevel int64)
- func (a *MenuRepository) GetSubNodeCount(id int64) (count int64)
- func (a *MenuRepository) InsertData(data *auth.Menu) (bool, error)
- 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.MenuWithButton)
- func (a *MenuRepository) UpdateData(data *auth.Menu) (bool, error)
- type RoleMenuRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorityRepository ¶
func (*AuthorityRepository) AssginAuthForOrg ¶
func (a *AuthorityRepository) AssginAuthForOrg(orgId, menuId, buttonId int64, nodeType string) (assignRes bool)
给组织机构(部门、岗位)分配菜单权限
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) DeleteAuthFromOrg ¶
func (a *AuthorityRepository) DeleteAuthFromOrg(roleId, menuId, buttonId int, nodeType string) bool
从组织机构(部门、岗位)删除权限
func (*AuthorityRepository) DeleteCasbibRules ¶
func (a *AuthorityRepository) DeleteCasbibRules(authPostMountHasMenuButtonId string, nodeType string) (resBool bool)
删除 casbin 表接口已分配的权限
func (*AuthorityRepository) GetAssignedMenuButtonList ¶
func (a *AuthorityRepository) GetAssignedMenuButtonList(roleId string) (counts int64, data []auth.AuthNode)
已分配给部门、岗位的系统菜单、按钮
func (*AuthorityRepository) GetButtonListByMenuId ¶
func (u *AuthorityRepository) GetButtonListByMenuId(roleIds []string, MenuId int64) (r []auth.Button)
查询用户在指定页面拥有的按钮列表
func (*AuthorityRepository) GetSystemMenuButtonList ¶
func (a *AuthorityRepository) GetSystemMenuButtonList() (counts int64, data []auth.AuthNode)
GetSystemMenuButtonList 待分配的系统菜单、按钮 数据列表 注意:按钮的id有可能和主菜单id重复,所以按钮id基准值增加 100000 (10万),后续分配权限时减去 10万即可
func (*AuthorityRepository) GetUserAuthorities ¶
func (a *AuthorityRepository) GetUserAuthorities(userId string) (result []auth.AuthNode)
根据用户id查询已经分配的菜单
type ButtonRepository ¶
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) 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) (nodeLevel int64)
获取菜单fid的节点深度
func (*MenuRepository) GetSubNodeCount ¶
func (a *MenuRepository) GetSubNodeCount(id int64) (count int64)
根据id查询是否有子节点数据
func (*MenuRepository) InsertData ¶
func (a *MenuRepository) InsertData(data *auth.Menu) (bool, error)
新增
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.MenuWithButton)
查询
func (*MenuRepository) UpdateData ¶
func (a *MenuRepository) UpdateData(data *auth.Menu) (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
Click to show internal directories.
Click to hide internal directories.