Documentation ¶
Index ¶
- type AllRoleRequest
- type MenuApi
- type Repo
- type Role
- type RoleClosure
- type RoleMenu
- type UseCase
- func (u *UseCase) AddRole(ctx kratosx.Context, in *Role) (uint32, error)
- func (u *UseCase) DeleteRole(ctx kratosx.Context, id uint32) error
- func (u *UseCase) GetRoleMenuIds(ctx kratosx.Context, id uint32) ([]uint32, error)
- func (u *UseCase) RoleTree(ctx kratosx.Context) (tree.Tree, error)
- func (u *UseCase) UpdateRole(ctx kratosx.Context, in *Role) error
- func (u *UseCase) UpdateRoleMenus(ctx kratosx.Context, roleId uint32, menuIds []uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllRoleRequest ¶
type Repo ¶
type Repo interface { GetRole(ctx kratosx.Context, id uint32) (*Role, error) AllRole(ctx kratosx.Context, in *AllRoleRequest) ([]*Role, error) AddRole(ctx kratosx.Context, in *Role) (uint32, error) UpdateRole(ctx kratosx.Context, in *Role) error DeleteRole(ctx kratosx.Context, id uint32) error ParentStatus(ctx kratosx.Context, id uint32) bool GetChildrenIds(ctx kratosx.Context, rid uint32) ([]uint32, error) GetParentIds(ctx kratosx.Context, rid uint32) ([]uint32, error) UpdateRoleMenus(ctx kratosx.Context, rid uint32, menuIds []uint32) error GetRoleMenuIds(ctx kratosx.Context, rid uint32) ([]uint32, error) AllMenuApiByIds(ctx kratosx.Context, ids []uint32) ([]*MenuApi, error) }
type Role ¶
type Role struct { types.BaseModel ParentId uint32 `json:"parent_id"` Name string `json:"name"` Keyword string `json:"keyword"` Status *bool `json:"status"` Description *string `json:"description"` DepartmentIds *string `json:"department_ids"` DataScope string `json:"data_scope"` Children []*Role `json:"children" gorm:"-"` }
type RoleClosure ¶
type RoleMenu ¶
type RoleMenu struct { types.CreateModel MenuId uint32 `json:"menu_id"` RoleId uint32 `json:"role_id"` }
Click to show internal directories.
Click to hide internal directories.