department.api
1.6 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
syntax = "v1"
info(
title: "部门分组"
desc: "部门分组"
author: "zz"
email: "email"
version: "v1"
)
@server(
prefix: v1
group: department
middleware: LoginStatusCheck,LogRequest
jwt: SystemAuth
)
service Core {
@doc "部门列表"
@handler systemList
post /system/department/list (DepartmentListRequest) returns (DepartmentListResponse)
@doc "部门-新增"
@handler systemAdd
post /system/department/add (DepartmentAddRequest) returns (DepartmentGetResponse)
@doc "部门-详情"
@handler systemGet
get /system/department/:id (DepartmentGetRequest) returns (DepartmentGetResponse)
@doc "部门-更新"
@handler systemUpdate
put /system/department/:id (DepartmentUpdateRequest) returns (DepartmentGetResponse)
@doc "部门-删除"
@handler systemDelete
delete /system/department/:id (DepartmentGetRequest) returns (DepartmentGetResponse)
}
type (
DepartmentAddRequest {
Name string `json:"name"` // 分组名称
Ids []int64 `json:"ids"` // 用户ID
}
DepartmentGetRequest {
Id int64 `path:"id"`
}
DepartmentGetResponse struct{
Department Department `json:"department"`
}
DepartmentUpdateRequest {
Id int64 `path:"id"`
Name string `json:"name"`
Ids []int64 `json:"ids"` // 用户ID
}
DepartmentListRequest {
Page int `json:"page"`
Size int `json:"size"`
}
DepartmentListResponse {
List []Department `json:"list"`
Total int64 `json:"total"`
}
)