# 字典接口
# 定义
# 字典类型实体(TreeDictTypeModel)
名称 | 类型 | 字`段名 | 描述 |
---|---|---|---|
主键 | String | id | |
名称 | String | name | |
编码 | String | code | |
组织主键 | String | orgId | |
描述 | String | description | |
用户只读 | Integer | userRead | |
用户可见 | Integer | userDisplay | |
应用ID | String | systemId |
# 字典项实体(TreeDictItemModel)
主键 | 类型 | 字段 | 描述 |
---|---|---|---|
主键 | String | id | |
单据编号 | String | code | |
字典类别主键 | String | dictTypeId | |
名称 | String | name | |
父节点主键 | String | parentId | |
层级 | Integer | level | |
用户只读 | Integer | userRead | |
用户可见 | Integer | userDisplay | |
使用状态 | Integer | state | 0 禁用 1 启用 |
父节点编码 | String | parentCode |
# 字典项返回实体(TreeDictItemResModel)
主键 | 类型 | 字段 | 描述 |
---|---|---|---|
主键 | String | id | |
单据编号 | String | code | |
组织主键 | String | orgId | |
字典类别主键 | String | dictTypeId | |
名称 | String | name | |
父节点主键 | String | parentId | |
路径 | String | treePath | |
排序 | Integer | orderNum | |
创建人名称 | String | creatUserName | |
创建人主键 | String | 创建人主键 | |
层级 | Integer | level | |
叶子节点 | boolean | leaf | |
用户只读 | Integer | userRead | |
用户可见 | Integer | userDisplay | |
使用状态 | Integer | state | 0 禁用 1 启用 |
应用ID | String | systemId | |
父节点编码 | String | parentCode | |
描述 | String | description | |
子节点 | List(TreeDictItemResModel) | children |
分页模型(PageModel)
名称 | 类型 | 字段 | 描述 |
---|---|---|---|
分页大小 | int | pageSize | 每页显示记录数 |
当前页 | int | currentPage | 当前页码 |
# 接口
# 创建字典类型
请求路径
/api/basis/tree/dict/type/
请求方法
POST
接口参数
名称 类型 字段名 描述 字典类型实体 TreeDictTypeModel treeDictItem 返回信息
名称 类型 字段名 描述 字典类型实体 TreeDictTypeModel 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/type/
1{ "code": "TestCode1", "name": "测试类型", "userDisplay": 1, "userRead": 1, "description": "测试类型" }
1
2
3
4
5
6
7返回结果
{ "uuid": "25a0f180-c5e6-45cd-ba40-e2cd3064588d", "code": "000000", "msg": "成功", "data": { "id": "1452619928653283328", "code": "TestCode1", "orgId": null, "description": "测试类型", "name": "测试类型", "userRead": 1, "userDisplay": 1, "systemId": null }, "ok": true }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 校验字典类型name,code重复
请求路径
/api/basis/tree/dict/type/check
请求方法
POST
接口参数
名称 类型 字段名 描述 字典类型实体 TreeDictTypeModel treeDictItem 返回信息
名称 类型 字段名 描述 字典类型实体 boolean flag true:成功 false:重复 字典类型实体 String res 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/type/check
1{ "code": "test123", "name": "测试123" }
1
2
3
4返回结果
{ "uuid": "631e7a6f-c68c-4c7f-b427-eb6b3707b607", "code": "000000", "msg": "成功", "data": { "res": "成功", "flag": true }, "ok": true }
1
2
3
4
5
6
7
8
9
10
# 编辑字典类型
请求路径
/api/basis/tree/dict/type/{id}
请求方法
PUT
接口参数
名称 类型 字段名 描述 主键Id String id 必传 字典类型实体 TreeDictTypeModel treeDictItem 返回信息
名称 类型 字段名 描述 字典类型实体 TreeDictTypeModel 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/type/1452619928653283328
1{ "code": "TestCode1", "name": "测试类型", "userDisplay": 1, "userRead": 1, "description": "测试类型", "id": "1452619928653283328", "orgId": null, "systemId": "12305", "menu": 0 }
1
2
3
4
5
6
7
8
9
10
11返回结果
{ "uuid": "9d1471cc-6684-4ae9-9e36-24d0026e6e73", "code": "000000", "msg": "成功", "data": { "id": "1452619928653283328", "code": "TestCode1", "orgId": null, "description": "测试类型", "name": "测试类型", "userRead": 1, "userDisplay": 1, "systemId": "12305" }, "ok": true }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 根据id查询字典类型
请求路径
/api/basis/tree/dict/type/{id}
请求方法
GET
接口参数
名称 类型 字段名 描述 主键Id String id 必传 返回信息
名称 类型 字段名 描述 字典类型实体 TreeDictTypeModel 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/type/1452619928653283328
1返回结果
{ "uuid": "72b89e2c-7381-4b3e-a92a-a47ace6b9216", "code": "000000", "msg": "成功", "data": { "id": "1452619928653283328", "code": "TestCode1", "orgId": null, "description": "测试类型", "name": "测试类型", "userRead": 1, "userDisplay": 1, "systemId": "12305" }, "ok": true }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 删除字典类型
请求路径
/api/basis/tree/dict/type/batch
请求方法
DELETE
接口参数
名称 类型 字段名 描述 字典类型主键Id集合 List(String) ids 必传 返回信息
名称 类型 字段名 描述 boolean 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/type/batch/
1[ "1452619928653283328" ]
1
2
3返回结果
{ "uuid": "937878ad-21b0-449d-9bae-eb825174b719", "code": "000000", "msg": "成功", "data": true, "ok": true }
1
2
3
4
5
6
7
# 查询字典类型列表
请求路径
/api/basis/tree/dict/type/
请求方法
GET
接口参数
名称 类型 字段名 描述 返回信息
名称 类型 字段名 描述 字典类型实体 TreeDictTypeModel 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/type/
1返回结果
{ "uuid": "27656b0a-5d5d-4bbe-92a7-8a89ceff3bf0", "code": "000000", "msg": "成功", "data": [ { "id": "1452619928653283328", "code": "TestCode1", "orgId": null, "description": "测试类型", "name": "测试类型", "userRead": 1, "userDisplay": 1, "systemId": "12305" } ], "ok": true }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 创建字典项
在字典类型下创建字典项
请求路径
/api/basis/tree/dict/item/
请求方法
POST
接口参数
名称 类型 字段名 描述 字典项实体 TreeDictItemModel treeDictItem 返回信息
名称 类型 字段名 描述 字典类型返回实体 TreeDictItemResModel 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/item/
1{ "code": "TestItem1", "name": "测试字典项1", "userRead": 1, "state": 1, "description": "测试字典项", "parentId": 0, "parentCode": "TestCode1", "level": 1, "dictTypeId": "1452619928653283328" }
1
2
3
4
5
6
7
8
9
10
11返回结果
{ "uuid": "f1274c7b-e27d-46bd-bfce-f5d2c74053f3", "code": "000000", "msg": "成功", "data": { "id": "1452631524762992640", "code": "TestItem1", "orgId": null, "dictTypeId": "1452619928653283328", "name": "测试字典项1", "parentId": "0", "treePath": "1452631524762992640/", "orderNum": 1, "creatUserName": "admin", "creatUserId": "1", "level": 1, "leaf": false, "userRead": 1, "userDisplay": 1, "state": 1, "systemId": "12305", "parentCode": "TestCode1", "description": null, "children": [ ] }, "ok": true }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 编辑字典项
请求路径
/api/basis/tree/dict/item/{id}
请求方法
PUT
接口参数
名称 类型 字段名 描述 主键Id String id 必传 字典项返回实体 TreeDictItemResModel treeDictItem 必传 返回信息
名称 类型 字段名 描述 字典类型返回体 TreeDictItemResModel 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/item/1452631524762992640
1{ "code": "TestItem1", "name": "测试字典项1", "userRead": 1, "state": 1, "description": null, "id": "1452631524762992640", "orgId": null, "dictTypeId": "1452619928653283328", "parentId": 0, "treePath": "1452631524762992640/", "orderNum": 1, "creatUserName": "admin", "creatUserId": "1", "level": 1, "leaf": true, "userDisplay": 1, "systemId": null, "parentCode": "TestCode1", "children": [ ], "hasChildren": false }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24返回结果
{ "uuid": "ad651621-2814-43bf-a680-0768aeec312d", "code": "000000", "msg": "成功", "data": { "id": "1452631524762992640", "code": "TestItem1", "orgId": null, "dictTypeId": "1452619928653283328", "name": "测试字典项1", "parentId": "0", "treePath": "1452631524762992640/", "orderNum": 1, "creatUserName": "admin", "creatUserId": "1", "level": 1, "leaf": false, "userRead": 1, "userDisplay": 1, "state": 1, "systemId": "12305", "parentCode": "TestCode1", "description": null, "children": [ ] }, "ok": true }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 根据条件查询字典项数量
该接口支持编码、字典类型Id等多条件查询数量
请求路径
/api/basis/tree/dict/item/count
请求方法
GET
接口参数
名称 类型 字段名 描述 字典项实体 TreeDictItemModel model 按需传入需要的字段即可 返回信息
名称 类型 字段名 描述 数量 int 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/item/count?code=ddd&dictTypeId=1452805733443190784
1返回结果
{ "uuid": "f0eda77b-991d-42ff-90ea-28bcb2dfe514", "code": "000000", "msg": "成功", "data": 0, "ok": true }
1
2
3
4
5
6
7
# 根据id查询字典项
请求路径
/api/basis/tree/dict/item/{id}
请求方法
GET
接口参数
名称 类型 字段名 描述 主键Id String id 必传 返回信息
名称 类型 字段名 描述 字典类型返回体 TreeDictItemResModel 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/item/1452619928653283328
1返回结果
{ "uuid": "ad651621-2814-43bf-a680-0768aeec312d", "code": "000000", "msg": "成功", "data": { "id": "1452631524762992640", "code": "TestItem1", "orgId": null, "dictTypeId": "1452619928653283328", "name": "测试字典项1", "parentId": "0", "treePath": "1452631524762992640/", "orderNum": 1, "creatUserName": "admin", "creatUserId": "1", "level": 1, "leaf": false, "userRead": 1, "userDisplay": 1, "state": 1, "systemId": "12305", "parentCode": "TestCode1", "description": null, "children": [ ] }, "ok": true }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 根据id删除字典项
请求路径
/api/basis/tree/dict/item/{id}
请求方法
DELETE
接口参数
名称 类型 字段名 描述 字典项主键Id集合 List(String) ids 必传 返回信息
名称 类型 字段名 描述 boolean 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/item/batch
1[ "1452631524762992640" ]
1
2
3返回结果
{ "uuid": "27a8f046-0a9b-40a4-aba7-6914a4b39f44", "code": "000000", "msg": "成功", "data": true, "ok": true }
1
2
3
4
5
6
7
# 禁用字典项
请求路径
/api/basis/tree/dict/item/batch/unenable
请求方法
GET
接口参数
名称 类型 字段名 描述 字典项主键Id集合 List(String) ids 必传 返回信息
名称 类型 字段名 描述 boolean 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/item/batch/unenable
1[ "1452631524762992640" ]
1
2
3返回结果
{ "uuid": "f936bb59-8141-4c50-a9d9-19d855d787d3", "code": "000000", "msg": "成功", "data": true, "ok": true }
1
2
3
4
5
6
7
# 启用字典项
请求路径
/api/basis/tree/dict/item/batch/enable
请求方法
GET
接口参数
名称 类型 字段名 描述 字典项主键Id集合 List(String) ids 必传 返回信息
名称 类型 字段名 描述 boolean 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/item/batch/enable
1[ "1452631524762992640" ]
1
2
3返回结果
{ "uuid": "762250a1-8b39-4991-85c2-20044066fb91", "code": "000000", "msg": "成功", "data": true, "ok": true }
1
2
3
4
5
6
7
# 根据字典类型分页查询字典项列表
请求路径
/api/basis/tree/dict/item/children/leaf
请求方法
GET
接口参数
名称 类型 字段名 描述 父节点主键 String parentId 必传 字典类别主键 String treeDictTypeId 分页模型 PageModel pageModel 返回信息
名称 类型 字段名 描述 字典类型返回体 TreeDictItemResModel 请求范例
http://gosp.glink.glkyun.com/api/basis/tree/dict/item/children/leaf?parentId=0&treeDictTypeId=1452619928653283328
1返回结果
{ "uuid": "d0deaac3-2508-4ce3-96f7-b6201c08c5fe", "code": "000000", "msg": "成功", "data": [ { "id": "1452631524762992640", "code": "TestItem1", "orgId": null, "dictTypeId": "1452619928653283328", "name": "测试字典项1", "parentId": "0", "treePath": "1452631524762992640/", "orderNum": 1, "creatUserName": "admin", "creatUserId": "1", "level": 1, "leaf": true, "userRead": 1, "userDisplay": 1, "state": 1, "systemId": null, "parentCode": "TestCode1", "description": null, "children": [ ] } ], "ok": true }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 根据应用Id查询字典项列表
请求路径
/api/basis/jsonp/reg_dict/{systemId}
请求方法
GET
接口参数
名称 类型 字段名 描述 应用Id String systemId 必传 返回信息
名称 类型 字段名 描述 字典项返回体 ResponseEntity(String) 请求范例
http://gosp.glink.glkyun.com/api/basis/jsonp/reg_dict/12305
1返回结果
window.registerLookups([ { "children": [ ], "code": "preview", "id": "1412674400960397312", "name": "预览", "orderNum": 12, "parentCode": "MENU_OPERATE", "parentId": "0" } ])
1
2
3
4
5
6
7
8
9
10
11
12
13