Documentation ¶
Index ¶
- Constants
- type DataScope
- type Department
- type GetDepartmentRequest
- type ListDepartmentRequest
- type Repo
- type UseCase
- func (u *UseCase) CreateDepartment(ctx kratosx.Context, req *Department) (uint32, error)
- func (u *UseCase) DeleteDepartment(ctx kratosx.Context, ids []uint32) (uint32, error)
- func (u *UseCase) GetDepartment(ctx kratosx.Context, req *GetDepartmentRequest) (*Department, error)
- func (u *UseCase) ListDepartment(ctx kratosx.Context, req *ListDepartmentRequest) ([]tree.Tree, uint32, error)
- func (u *UseCase) UpdateDepartment(ctx kratosx.Context, req *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 Department ¶
type Department struct { Id uint32 `json:"id"` ParentId uint32 `json:"parentId"` Name string `json:"name"` Keyword string `json:"keyword"` Description *string `json:"description"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` Children []*Department `json:"Children"` }
func (*Department) AppendChildren ¶
func (m *Department) AppendChildren(child any)
AppendChildren 添加子节点
func (*Department) ChildrenNode ¶
func (m *Department) ChildrenNode() []tree.Tree
ChildrenNode 获取子节点
type GetDepartmentRequest ¶ added in v1.0.15
type ListDepartmentRequest ¶ added in v1.0.15
type ListDepartmentRequest struct { Order *string `json:"order"` OrderBy *string `json:"orderBy"` Name *string `json:"name"` Keyword *string `json:"keyword"` Ids []uint32 `json:"ids"` }
ListDepartmentRequest fixed code
type Repo ¶
type Repo interface { // ListDepartment 获取部门信息列表 ListDepartment(ctx kratosx.Context, req *ListDepartmentRequest) ([]*Department, uint32, error) // CreateDepartment 创建部门信息 CreateDepartment(ctx kratosx.Context, req *Department) (uint32, error) // UpdateDepartment 更新部门信息 UpdateDepartment(ctx kratosx.Context, req *Department) error // DeleteDepartment 删除部门信息 DeleteDepartment(ctx kratosx.Context, ids []uint32) (uint32, error) // GetDepartmentParentIds 获取父部门信息ID列表 GetDepartmentParentIds(ctx kratosx.Context, id uint32) ([]uint32, error) // GetDepartmentChildrenIds 获取子部门信息ID列表 GetDepartmentChildrenIds(ctx kratosx.Context, id uint32) ([]uint32, error) // GetDepartment 获取指定的部门信息 GetDepartment(ctx kratosx.Context, id uint32) (*Department, error) // GetDepartmentByKeyword 获取指定的部门信息 GetDepartmentByKeyword(ctx kratosx.Context, keyword string) (*Department, error) // GetDepartmentDataScope 获取指定用户的部门权限 GetDepartmentDataScope(ctx kratosx.Context, uid uint32) (bool, []uint32, error) }
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
func (*UseCase) CreateDepartment ¶ added in v1.0.15
CreateDepartment 创建部门信息 fixed code
func (*UseCase) DeleteDepartment ¶
DeleteDepartment 删除部门信息 fixed code
func (*UseCase) GetDepartment ¶ added in v1.0.15
func (u *UseCase) GetDepartment(ctx kratosx.Context, req *GetDepartmentRequest) (*Department, error)
GetDepartment 获取指定的部门信息
func (*UseCase) ListDepartment ¶ added in v1.0.15
func (u *UseCase) ListDepartment(ctx kratosx.Context, req *ListDepartmentRequest) ([]tree.Tree, uint32, error)
ListDepartment 获取部门信息列表树 fixed code
func (*UseCase) UpdateDepartment ¶
func (u *UseCase) UpdateDepartment(ctx kratosx.Context, req *Department) error
UpdateDepartment 更新部门信息 fixed code
Click to show internal directories.
Click to hide internal directories.