部署测试

This commit is contained in:
2024-08-01 14:51:51 +08:00
parent f9bb041a2e
commit 81ffde828c
13 changed files with 569 additions and 11 deletions

View File

@@ -9,11 +9,12 @@ import (
type department struct {
}
type DepartmentItem struct {
Id int64 `json:"id"`
Name string `json:"name"`
ParentId int64 `json:"parentId"`
CreatedAt time.Time `json:"createdAt"`
Children []*DepartmentItem `json:"children"`
Id int64 `json:"id"`
Name string `json:"name"`
ParentId int64 `json:"parentId"`
ManageStaffId int64 `json:"manageStaffId"`
CreatedAt time.Time `json:"createdAt"`
Children []*DepartmentItem `json:"children"`
}
// All @TITLE 获取部门
@@ -27,8 +28,9 @@ func (d *department) All(ctx context.Context) (reply []DepartmentItem, err error
}
type ArgsDepartmentAdd struct {
Name string // 部门名称
ParentId int64 // 上级部门id
Name string // 部门名称
ParentId int64 // 上级部门id
ManageStaffId int64 // 部门负责人
}
// Add @TITLE 添加部门
@@ -41,6 +43,16 @@ func (d *department) Add(ctx context.Context, args ArgsDepartmentAdd) (err error
return xClient.Call(ctx, "Add", args, &reply)
}
// Info @TITLE 部门详情
func (d *department) Info(ctx context.Context, departmentId int64) (reply DepartmentItem, err error) {
xClient, err := client.GetClient(d)
if err != nil {
return
}
err = xClient.Call(ctx, "Info", departmentId, &reply)
return
}
type ArgsDepartmentEdit struct {
DepartmentId int64 // 部门id
ArgsDepartmentAdd