department.api
3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
syntax = "v1"
// 后台接口
@server(
prefix: v1
group: department
middleware: LogRequest
jwt: SystemAuth
)
service Core {
@doc "部门-详情"
@handler systemDepartmentGet
get /system/department/:id (DepartmentGetRequest) returns (DepartmentGetResponse)
@doc "部门-保存"
@handler systemDepartmentSave
post /system/department (DepartmentSaveRequest) returns (DepartmentSaveResponse)
@doc "部门-删除"
@handler systemDepartmentDelete
delete /system/department/:id (DepartmentDeleteRequest) returns (DepartmentDeleteResponse)
@doc "部门-更新"
@handler systemDepartmentUpdate
put /system/department/:id (DepartmentUpdateRequest) returns (DepartmentUpdateResponse)
@doc "部门-搜索"
@handler systemDepartmentSearch
post /system/department/search (DepartmentSearchRequest) returns (DepartmentSearchResponse)
@doc "部门-批量删除"
@handler systemDepartmentBatchDelete
delete /system/department/batch-del (DepartmentBatchDeleteRequest) returns (DepartmentBatchDeleteResponse)
@doc "部门-批量导入"
@handler systemDepartmentImport
delete /system/department/import (DepartmentImportRequest) returns (DepartmentImportResponse)
@doc "部门-批量导出"
@handler systemDepartmentExport
delete /system/department/export (DepartmentSearchRequest) returns (DepartmentSearchResponse)
@doc "公司部门"
@handler systemCompanyDepartments
post /system/company-departments (DepartmentSearchRequest) returns (DepartmentSearchResponse)
}
type(
DepartmentGetRequest {
Id int64 `path:"id"`
}
DepartmentGetResponse {
Department Department `json:"department"`
ParentDepartment Department `json:"parentDepartment"`
}
DepartmentSaveRequest {
Department Department `json:"department"`
}
DepartmentSaveResponse {}
DepartmentDeleteRequest {
Id int64 `path:"id"`
}
DepartmentDeleteResponse {}
DepartmentUpdateRequest {
Id int64 `path:"id"`
Department Department `json:"department"`
}
DepartmentUpdateResponse {}
DepartmentSearchRequest {
Page int `json:"page,optional"`
Size int `json:"size,optional"`
DepartmentHead string `json:"departmentHead,optional"` // 部门负责人
DepartmentName string `json:"departmentName,optional"` // 部门名称
CountUserNumber bool `json:"countUserNumber,optional"` // 统计用户数量
}
DepartmentSearchResponse{
List []Department `json:"list"`
Total int64 `json:"total"`
}
Department {
Id int64 `json:"id,string,optional,omitempty"` // 唯一标识
Name string `json:"name,omitempty"` // 名称
Code string `json:"code,optional,omitempty"` // 部门编码
ParentId int64 `json:"parentId,optional,omitempty"` // 父级部门ID
DepartmentHeads []User `json:"departmentHeads,optional,omitempty"` // 部门负责人
NumberPeople int64 `json:"numberPeople,optional,omitempty"` // 部门人数
}
)
type(
// 部门-批量删除
DepartmentBatchDeleteRequest{
Departments []int64 `json:"departments"`
}
DepartmentBatchDeleteResponse{}
// 部门-批量导入
DepartmentImportRequest{}
DepartmentImportResponse{}
)