请求接口
POST /api/organization/_all/tree
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| X-Access-Token | header | string | 是 | 平台 token |
| body | body | object | 否 | - |
| » paging | body | boolean | 否 | 是否分页,默认为false |
| » sorts | body | [object] | 否 | 排序 |
| »» name | body | string | 否 | 排序名称,默认为sortIndex |
| »» order | body | string | 否 | 排序方式:asc(升序)、desc(降序) |
响应参数
以200 Response为例,响应参数如下:
| 名称 | 类型 | 必选 | 约束 | 说明 |
|---|---|---|---|---|
| » message | string | true | none | 返回信息 |
| » result | object | true | none | 返回结果 |
| »» id | string | true | none | ID |
| »» path | string | true | none | 路径 |
| »» sortIndex | integer | true | none | 排序索引 |
| »» level | integer | true | none | 层级 |
| »» name | string | true | none | 名称 |
| »» creatorId | string | true | none | 创建者ID |
| »» createTime | integer | true | none | 创建时间 |
| »» children | [object] | false | none | - |
| » status | integer | true | none | 状态码 |
| » timestamp | integer | true | none | 时间戳 |
若 level>1,则存在children ,children包含字段如下:
| 名称 | 类型 | 必选 | 约束 | 说明 |
|---|---|---|---|---|
| »» id | string | true | none | ID |
| »» path | string | true | none | 路径 |
| »» sortIndex | integer | true | none | 排序索引 |
| »» level | integer | true | none | 层级 |
| »» name | string | true | none | 名称 |
| »» creatorId | string | true | none | 创建者ID |
| »» createTime | integer | true | none | 创建时间 |
响应状态码
| 状态码 | 状态码含义 | 说明 |
|---|---|---|
| 200 | OK | 成功 |
| 401 | Unauthorized | 登录状态已过期,token不能为空 |
| 500 | Internal 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
}