Documentation ¶
Index ¶
- Constants
- type AllDepartmentObjectValueRequest
- type AllDepartmentRequest
- type DeleteDepartmentObjectRequest
- type Department
- type DepartmentClosure
- type DepartmentObject
- type Repo
- type UseCase
- func (u *UseCase) AddDepartment(ctx kratosx.Context, in *Department) (uint32, error)
- func (u *UseCase) AddDepartmentObject(ctx kratosx.Context, objectKey, value string) (uint32, error)
- func (u *UseCase) AllDepartmentObjectValue(ctx kratosx.Context, in *AllDepartmentObjectValueRequest) ([]string, error)
- func (u *UseCase) DeleteDepartment(ctx kratosx.Context, id uint32) error
- func (u *UseCase) DeleteDepartmentObject(ctx kratosx.Context, objectKey, value string) error
- func (u *UseCase) DepartmentTree(ctx kratosx.Context) ([]tree.Tree, error)
- func (u *UseCase) ImportDepartmentObject(ctx kratosx.Context, in []*DepartmentObject) error
- func (u *UseCase) UpdateDepartment(ctx kratosx.Context, in *Department) error
Constants ¶
View Source
const ( DataScopeAll = "ALL" // 所有部门 DataScopeCurrent = "CUR" // 当前部门 DataScopeCurrentDown = "CUR_DOWN" // 当前部门以及下级部门 DataScopeDown = "DOWN" // 下级部门 DataScopeCustom = "CUSTOM" // 自定义权限 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllDepartmentRequest ¶
type AllDepartmentRequest struct {
Ids []uint32
}
type Department ¶
type Department struct { types.BaseModel ParentId uint32 `json:"parent_id"` Keyword string `json:"keyword"` Name string `json:"name"` Description string `json:"description"` Children []*Department `json:"children" gorm:"-"` }
func (*Department) AppendChildren ¶
func (t *Department) AppendChildren(child any)
func (*Department) ChildrenNode ¶
func (t *Department) ChildrenNode() []tree.Tree
func (*Department) ID ¶
func (t *Department) ID() uint32
func (*Department) Parent ¶
func (t *Department) Parent() uint32
type DepartmentClosure ¶
type DepartmentObject ¶
type Repo ¶
type Repo interface { GetDepartment(ctx kratosx.Context, id uint32) (*Department, error) AllManagerDepartment(ctx kratosx.Context, uid uint32) ([]*Department, error) AllManagerDepartmentIds(ctx kratosx.Context, uid uint32) ([]uint32, error) AllDepartment(ctx kratosx.Context, in *AllDepartmentRequest) ([]*Department, error) AddDepartment(ctx kratosx.Context, in *Department) (uint32, error) UpdateDepartment(ctx kratosx.Context, in *Department) error DeleteDepartment(ctx kratosx.Context, id uint32) error GetScope(ctx kratosx.Context, uid, oid uint32) ([]string, error) AllDepartmentObjectValue(ctx kratosx.Context, did, oid uint32) ([]string, error) ImportDepartmentObject(ctx kratosx.Context, in []*DepartmentObject) error AddDepartmentObject(ctx kratosx.Context, in *DepartmentObject) (uint32, error) DeleteDepartmentObjectValue(ctx kratosx.Context, oid uint32, value string) error }
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
func (*UseCase) AddDepartment ¶
func (*UseCase) AddDepartmentObject ¶
AddDepartmentObject 添加部门资源对象
func (*UseCase) AllDepartmentObjectValue ¶
func (u *UseCase) AllDepartmentObjectValue(ctx kratosx.Context, in *AllDepartmentObjectValueRequest) ([]string, error)
AllDepartmentObjectValue 获取指定部门的指定资源对象的全部值
func (*UseCase) DeleteDepartment ¶
func (*UseCase) DeleteDepartmentObject ¶
DeleteDepartmentObject 删除部门资源对象
func (*UseCase) DepartmentTree ¶
DepartmentTree 查询当前用户的部门树
func (*UseCase) ImportDepartmentObject ¶
func (u *UseCase) ImportDepartmentObject(ctx kratosx.Context, in []*DepartmentObject) error
ImportDepartmentObject 导入部门资源对象
func (*UseCase) UpdateDepartment ¶
func (u *UseCase) UpdateDepartment(ctx kratosx.Context, in *Department) error
Click to show internal directories.
Click to hide internal directories.