# 区域API

# 列表

# 请求

  • Method: GET

  • Url: /personnel/api/areas/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Query Parameter

参数 描述
page
page_size
area_code
area_name
area_code_icontains
area_name_icontains
ordering id, dept_code, dept_name

# 响应

{
    "count": 27,
    "next": "null",
    "previous": null,
    "msg": "",
    "code": 0,
    "data": [
        {
            "id": 1,
            "area_code": "1",
            "area_name": "WORLD",
            "parent_area": null
        },
        {
            "id": 93,
            "area_code": "5190062",
            "area_name": "shenzhen",
            "parent_area": null
        },
        ...
        ...
}

# 读取

# 请求

  • Method: GET

  • Url: /personnel/api/areas/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameter

参数 描述
id 必填

# 响应

- **Url:** /personnel/api/areas/1/
{
    "id": 1,
    "area_code": "1",
    "area_name": "WORLD",
    "parent_area": null
}

# 创建

  • Method: POST
  • Url: /personnel/api/areas/
  • Headers:
    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body
{
    "area_code": "test area code",
    "area_name": "test area name",
    "parent_area": null
}
参数 必填 类型 描述
area_code Y String 区域编号
area_name Y String 区域名称
parent_area N Integer 上级区域

# 响应

{
    "id": 100,
    "area_code": "test area code",
    "area_name": "test area name",
    "parent_area": null
}

# 更新

# 请求

  • Method: PUT

  • Url: /personnel/api/areas/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameter

参数 描述
id 必填
  • Request Body
{
    "area_code": "11",
    "area_name": "test area name",
}
参数 必填 类型 描述
area_code Y String 区域编号
area_name Y String 区域名称
parent_area N Integer 上级区域

# 响应

- **Url:** PUT /personnel/api/areas/1/
{
    "id": 1,
    "area_code": "11",
    "area_name": "WORLD WORLD",
    "parent_area": null
}

# 删除

# 请求

  • Method: DELETE

  • Url: /personnel/api/areas/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameter

参数 描述
id 必填

# 响应

None