Skip to content

获取组织列表信息 (POST)

更新时间:

请求接口

POST /api/organization/_all/tree

TIP

访问权限:需要登录超级设备管理平台获取token,并校验token

请求参数

名称位置类型必选说明
X-Access-Tokenheaderstring平台 token
bodybodyobject-
» pagingbodyboolean是否分页,默认为false
» sortsbody[object]排序
»» namebodystring排序名称,默认为sortIndex
»» orderbodystring排序方式:asc(升序)、desc(降序)

响应参数

以200 Response为例,响应参数如下:

名称类型必选约束说明
» messagestringtruenone返回信息
» resultobjecttruenone返回结果
»» idstringtruenoneID
»» pathstringtruenone路径
»» sortIndexintegertruenone排序索引
»» levelintegertruenone层级
»» namestringtruenone名称
»» creatorIdstringtruenone创建者ID
»» createTimeintegertruenone创建时间
»» children[object]falsenone-
» statusintegertruenone状态码
» timestampintegertruenone时间戳

若 level>1,则存在childrenchildren包含字段如下:

名称类型必选约束说明
»» idstringtruenoneID
»» pathstringtruenone路径
»» sortIndexintegertruenone排序索引
»» levelintegertruenone层级
»» namestringtruenone名称
»» creatorIdstringtruenone创建者ID
»» createTimeintegertruenone创建时间

响应状态码

状态码状态码含义说明
200OK成功
401Unauthorized登录状态已过期,token不能为空
500Internal Server Error服务器内部异常

Body示例

json
{
  "paging":false,
  "sorts":[
    {
      "name":"sortIndex",
      "order":"asc"
    }
  ]
}
{
  "paging":false,
  "sorts":[
    {
      "name":"sortIndex",
      "order":"asc"
    }
  ]
}

返回示例

以200 Response为例:

json
{
  "message": "success",
  "result": [
    {
      "id": "01240008091987263488",
      "path": "Jch6",
      "sortIndex": 1,
      "level": 1,
      "name": "开鸿",
      "creatorId": "1199596756811550720",
      "createTime": 1667445607549,
      "children": [
        {
          "id": "1588443798870265856",
          "parentId": "1588008091987263488",
          "path": "Jch6-vlI2",
          "sortIndex": 1,
          "level": 2,
          "name": "测试",
          "creatorId": "1199596756811550720",
          "createTime": 1667549488162
        }
      ]
    }
  ],
  "status": 200,
  "timestamp": 1693474041981
}
{
  "message": "success",
  "result": [
    {
      "id": "01240008091987263488",
      "path": "Jch6",
      "sortIndex": 1,
      "level": 1,
      "name": "开鸿",
      "creatorId": "1199596756811550720",
      "createTime": 1667445607549,
      "children": [
        {
          "id": "1588443798870265856",
          "parentId": "1588008091987263488",
          "path": "Jch6-vlI2",
          "sortIndex": 1,
          "level": 2,
          "name": "测试",
          "creatorId": "1199596756811550720",
          "createTime": 1667549488162
        }
      ]
    }
  ],
  "status": 200,
  "timestamp": 1693474041981
}