API docsAPI docs
  • English
  • zh-CN
  • English
  • zh-CN
    • 概述
    • 请求 & 响应
    • 获取Auth Token
    • 使用 Auth Token
    • Api Example
    • 区域API
    • 部门API
    • 职位API
    • 人员API
    • 离职API
    • 设备API
    • 考勤记录API
    • 考勤报表API

区域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, area_code, area_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_codeYString区域编号
area_nameYString区域名称
parent_areaNInteger上级区域

响应

{
    "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_codeYString区域编号
area_nameYString区域名称
parent_areaNInteger上级区域

响应

- **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
Next
部门API