employee.api
5.1 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
syntax = "v1"
// 后台接口
@server(
prefix: v1
group: employee
middleware: LogRequest
jwt: SystemAuth
)
service Core {
@doc "职员-详情"
@handler systemEmployeeGet
get /system/employee/:id (EmployeeGetRequest) returns (EmployeeGetResponse)
@doc "职员-保存"
@handler systemEmployeeSave
post /system/employee (EmployeeSaveRequest) returns (EmployeeSaveResponse)
@doc "职员-删除"
@handler systemEmployeeDelete
delete /system/employee/:id (EmployeeDeleteRequest) returns (EmployeeDeleteResponse)
@doc "职员-更新"
@handler systemEmployeeUpdate
put /system/employee/:id (EmployeeUpdateRequest) returns (EmployeeUpdateResponse)
@doc "职员-搜索"
@handler systemEmployeeSearch
post /system/employee/search (EmployeeSearchRequest) returns (EmployeeSearchResponse)
@doc "职员-设置账号状态(启用、停用)"
@handler systemEmployeeSetAccountStatus
post /system/employee/set-account-status (EmployeeSetAccountStatusRequest) returns (EmployeeSetAccountStatusResponse)
@doc "职员-变更部门"
@handler systemEmployeeChangeDepartments
post /system/employee/change-departments (EmployeeChangeDepartmentsRequest) returns (EmployeeChangeDepartmentsResponse)
@doc "职员-导入"
@handler systemEmployeeImport
post /system/employee/import (EmployeeImportRequest) returns (EmployeeImportResponse)
@doc "职员-导出"
@handler systemEmployeeExport
post /system/employee/export (EmployeeSearchRequest) returns (EmployeeSearchResponse)
}
type(
EmployeeGetRequest {
Id int64 `path:"id"`
}
EmployeeGetResponse{
Employee Employee `json:"employee"`
}
EmployeeSaveRequest{
Employee Employee `json:"employee"`
}
EmployeeSaveResponse{}
EmployeeDeleteRequest{
Id int64 `path:"id"`
}
EmployeeDeleteResponse{}
EmployeeUpdateRequest{
Id int64 `path:"id"`
Employee Employee `json:"employee"`
}
EmployeeUpdateResponse{}
EmployeeSearchRequest{
Page int `json:"page,optional"`
Size int `json:"size,optional"`
AccountStatus *int `json:"accountStatus,optional"` // 1.正常 2.已暂停
Name string `json:"name,optional"` // 姓名
Phone string `json:"phone,optional"` // 手机号
DepartmentId int64 `json:"departmentId,optional"` // 按部门过滤
}
EmployeeSearchResponse{
List []Employee `json:"list"`
Total int64 `json:"total"`
}
Employee{
Id int64 `json:"id,optional,omitempty"`
Name string `json:"name,omitempty"` // 姓名
Code string `json:"code,omitempty"` // 员工编码
Phone string `json:"phone,omitempty"` // 手机号
Departments []Department `json:"departments,optional,omitempty"` // 部门列表
AccountStatus int `json:"accountStatus,optional,omitempty"` // 账号状态 1.正常 2.已暂停
EmployeeType string `json:"employeeType,optional,omitempty"` // 人员类型 正式、实习、外包、劳务、顾问
EmployedDate int64 `json:"employedDate,optional,omitempty"` // 入职时间
Superior *User `json:"superior,optional,omitempty"` // 直属上级
Roles []Role `json:"roles,optional,omitempty"` // 管理员角色
Groups []Group `json:"groups,optional,omitempty"` // 用户组
}
// 职员-设置账号状态(启用、停用)
EmployeeSetAccountStatusRequest{
EmployeeList []int64 `json:"employeeList"` // 职员列表
AccountStatus int `json:"accountStatus"` // 1.正常 2.已暂停
}
EmployeeSetAccountStatusResponse{}
// 职员-变更部门
EmployeeChangeDepartmentsRequest{
EmployeeList []int64 `json:"employeeList"` // 职员列表
Departments []int64 `json:"departments"`// 部门列表
}
EmployeeChangeDepartmentsResponse{}
// 职员-导入
EmployeeImportRequest{
}
EmployeeImportResponse{}
)
//type(
// Department {
// Id int64 `json:"id,optional,omitempty"` // 唯一标识
// Name string `json:"name,omitempty"` // 名称
// Code string `json:"code,omitempty"` // 部门编码
// ParentId int64 `json:"parentId,omitempty"` // 父级部门ID
// DepartmentHeads []User `json:"departmentHeads,optional,omitempty"` // 部门负责人
// NumberPeople int64 `json:"numberPeople,optional,omitempty"` // 部门人数
// }
// User{
// Id int64 `json:"id"` // 用户ID
// Name string `json:"name"` // 用户名称
// Phone string `json:"phone,omitempty"` // 用户手机号
// }
// Group {
// Id int64 `json:"id"` // 分组ID
// Name string `json:"name"` // 分组名称
// }
// Role{
// Id int64 `json:"id"` // 角色ID
// Name string `json:"name"` // 角色名称
// }
//)