Appearance
部门
获取部门
GET /org/{type}
权限
- 需要认证
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
type | path | string | true | 'userManageOrg'管理的组织机构,用于设置所属部门, 'resourcePermissionOrg'资源发布范围加入范围,人员的管理范围 |
settingOrgIds | query | string | false | 类型为'resourcePermissionOrg'表示资源已经设置的数据 |
响应
json
[
{
"id": "1",
"name": "测试企业微信",
"parentId": "0",
"depth": "1",
"seq": "0",
"code": "FullSite",
"orgCode": "1.",
"selectable": true,
"disableCheckbox": false,
"nodes": [
{
"id": "1046",
"name": "技术部",
"parentId": "1",
"depth": "2",
"seq": "0",
"code": "dingtalk2",
"orgCode": "1.1046.",
"selectable": true,
"disableCheckbox": false,
"nodes": [
{
"id": "1050",
"name": "sql审计",
"parentId": "1046",
"depth": "3",
"seq": "0",
"code": "dingtalk8",
"orgCode": "1.1046.1050.",
"selectable": true,
"disableCheckbox": false,
"nodes": []
}
]
},
{
"id": "1047",
"name": "销售部1",
"parentId": "1",
"depth": "2",
"seq": "0",
"code": "dingtalk4",
"orgCode": "1.1047.",
"selectable": true,
"disableCheckbox": false,
"nodes": [
{
"id": "1049",
"name": "催收部",
"parentId": "1047",
"depth": "3",
"seq": "0",
"code": "dingtalk6",
"orgCode": "1.1047.1049.",
"selectable": true,
"disableCheckbox": false,
"nodes": []
}
]
},
{
"id": "1048",
"name": "质控部",
"parentId": "1",
"depth": "2",
"seq": "0",
"code": "dingtalk5",
"orgCode": "1.1048.",
"selectable": true,
"disableCheckbox": false,
"nodes": []
},
{
"id": "1051",
"name": "市场部",
"parentId": "1",
"depth": "2",
"seq": "0",
"code": "dingtalk10",
"orgCode": "1.1051.",
"selectable": true,
"disableCheckbox": false,
"nodes": []
},
{
"id": "1052",
"name": "132312",
"parentId": "1",
"depth": "2",
"seq": "0",
"code": "dingtalk14",
"orgCode": "1.1052.",
"selectable": true,
"disableCheckbox": false,
"nodes": [
{
"id": "1053",
"name": "32423",
"parentId": "1052",
"depth": "3",
"seq": "0",
"code": "dingtalk13",
"orgCode": "1.1052.1053.",
"selectable": true,
"disableCheckbox": false,
"nodes": []
}
]
},
{
"id": "1054",
"name": "楚氏部门",
"parentId": "1",
"depth": "2",
"seq": "0",
"code": "CSBM",
"orgCode": "1.1054.",
"selectable": true,
"disableCheckbox": false,
"nodes": [
{
"id": "1055",
"name": "楚家军部门",
"parentId": "1054",
"depth": "3",
"seq": "0",
"code": "CJJBM",
"orgCode": "1.1054.1055.",
"selectable": true,
"disableCheckbox": false,
"nodes": []
}
]
}
]
}
]
字段说明
名称 | 类型 | 必选 | 约束 | 说明 |
---|---|---|---|---|
» id | integer(int64) | false | none | none |
» seq | integer | false | none | none |
» code | string | false | none | none |
» orgCode | string | false | none | none |
» selectable | boolean | false | none | 是否可选中 |
» name | string | false | none | none |
» depth | integer(int64) | false | none | 层级 |
» nodes | object | false | none | none |
»» id | integer(int64) | false | none | none |
»» seq | integer | false | none | none |
»» code | string | false | none | none |
»» orgCode | string | false | none | none |
»» selectable | boolean | false | none | 是否可选中 |
»» name | string | false | none | none |
»» depth | integer(int64) | false | none | 层级 |
»» nodes | object | false | none | none |
搜索部门
GET /org/search
权限
- 需要认证
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
name | query | string | false | 部门名称 |
响应
json
{
"data": [
{
"id": "3",
"name": "1234",
"parentId": "1",
"childrenNum": "1",
"depth": "2",
"seq": "0",
"description": null,
"code": "JXEQ",
"orgCode": "1.3.",
"createdUserId": "2",
"createdTime": "1644914071",
"updateTime": "1644914144",
"syncId": "0",
"fullName": "1234"
},
{
"id": "2",
"name": "123",
"parentId": "1",
"childrenNum": "0",
"depth": "2",
"seq": "1",
"description": null,
"code": "YJY",
"orgCode": "1.2.",
"createdUserId": "2",
"createdTime": "1644914071",
"updateTime": "1644914144",
"syncId": "0",
"fullName": "123"
},
{
"id": "4",
"name": "1234",
"parentId": "3",
"childrenNum": "0",
"depth": "3",
"seq": "0",
"description": null,
"code": "PMHL",
"orgCode": "1.3.4.",
"createdUserId": "2",
"createdTime": "1644919061",
"updateTime": "1644919061",
"syncId": "0",
"fullName": "1234-1234"
},
{
"id": "6",
"name": "111111",
"parentId": "5",
"childrenNum": "0",
"depth": "3",
"seq": "0",
"description": null,
"code": "BTSMKB",
"orgCode": "1.5.6.",
"createdUserId": "2",
"createdTime": "1645003086",
"updateTime": "1645003086",
"syncId": "0",
"fullName": "55555-111111"
}
],
"paging": {
"total": 4,
"offset": 0,
"limit": 10
}
}
字段说明
名称 | 类型 | 必选 | 约束 | 说明 |
---|---|---|---|---|
» id | integer(int64) | false | none | none |
» name | string | false | none | 名称 |
» fullName | string | false | none | 包含上级部门名称(除顶级) |
创建部门
POST /api_v3/admin/org
- 支持版本
>=24.2.3
- 权限
admin_org_manage
参数
字段 | 是否必须 | 描述 |
---|---|---|
name string(200) | 是 | 名称 |
parentCode string(200) | 是 | 父级部门编码 |
code string(200) unique | 否 | 部门编码 |
成功响应
更新部门
POST /api_v3/admin/org/{orgId}
- 支持版本
>=24.2.3
- 权限
admin_org_manage
参数
字段 | 是否必须 | 描述 |
---|---|---|
orgId int | 是 | 部门ID |
name string(200) | 否 | 名称 |
parentCode string(200) | 否 | 父部门编码 |
code string(200) unique | 否 | 机构编码 |
成功响应
删除部门
POST /api_v3/admin/org/{orgId}/delete
- 支持版本
>=24.2.3
- 权限
admin_org_manage
参数
字段 | 是否必须 | 描述 |
---|---|---|
orgId int | 是 | 部门ID |
成功响应
json
{
"status": true
}
实体
部门
示例
json
{
"id": 123,
"name": "Department A",
"parentId": 0,
"childrenNum": 5,
"depth": 1,
"seq": 0,
"description": "This is Department A",
"code": "DEPT-A",
"orgCode": "1.DEPT-A.",
"createdUserId": 456,
"createdTime": 1644914071,
"updateTime": 1644914144,
"syncId": "SYNC-123"
}
字段说明
名称 | 说明 |
---|---|
id integer(int64) | 部门ID |
name string | 名称 |
parentId integer(int64) | 部门父ID |
childrenNum integer(uint32) | 辖下部门数量 |
depth integer | 当前部门层级 |
seq integer | 排序 |
description string | 描述 |
code string(255) | 编码 |
orgCode string(255) | 内部编码 |
createdUserId integer | 创建用户ID |
createdTime integer(uint32) | 创建时间 |
updateTime integer(uint32) | 最后更新时间 |
syncId string(255) | 同步部门ID |