# 职位API
# 列表
# 请求
Method: GET
Url: /personnel/api/positions/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Query Parameters
参数 | 描述 |
---|---|
page | |
page_size | |
position_code | |
position_name | |
position_code_icontains | |
position_name_icontains | |
ordering | id, dept_code, dept_name |
# 响应
{
"count": 27,
"next": "null",
"previous": null,
"msg": "",
"code": 0,
"data": [
{
"id": 1,
"position_code": "1",
"position_name": "WORLD",
"parent_position": null
},
{
"id": 93,
"position_code": "5190062",
"position_name": "shenzhen",
"parent_position": null
},
...
...
}
# 读取
# 请求
Method: GET
Url: /personnel/api/positions/{id}/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Path Parameters
参数 | 描述 |
---|---|
id | 必填 |
# 响应
- **Url:** /personnel/api/positions/1/
{
"id": 1,
"position_code": "1",
"position_name": "WORLD",
"parent_position": null
}
# 创建
- Method: POST
- Url: /personnel/api/positions/
- Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
- Request Body
{
"position_code": "test position code",
"position_name": "test position name",
"parent_position": null
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
position_code | Y | String | 职位编号 |
position_name | Y | String | 职位名称 |
parent_position | N | Integer | 上级职位 |
# 响应
{
"id": 100,
"position_code": "test position code",
"position_name": "test position name",
"parent_position": null
}
# Update
# 请求
Method: PUT
Url: /personnel/api/positions/{id}/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Path Parameters
参数 | 描述 |
---|---|
id | 必填 |
- Request Body
{
"position_code": "11",
"position_name": "test position name",
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
position_code | Y | String | 职位编号 |
position_name | Y | String | 职位名称 |
parent_position | N | Integer | 上级职位 |
# 响应
- **Url:** PUT /personnel/api/positions/1/
{
"id": 1,
"position_code": "11",
"position_name": "WORLD WORLD",
"parent_position": null
}
# 删除
# 请求
Method: DELETE
Url: /personnel/api/positions/{id}/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Path Parameters
参数 | 描述 |
---|---|
id | 必填 |
# 响应
None