restfulApi管理配置
1. 功能介绍
info
- restfulApi操作类型:创建记录、更新记录、删除记录、查询记录、新增或更新记录
- 执行系统版本要求:最新版本(2023.05.30后升级的)
- restfulApi管理配置: 使用restfulApi功能前,需要设置为
true
访问目录:配置中心 → 系统高级配置 → 系统维护 → 配置管理
2. 查询表结构
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/meta/{构件编码}/{业务表名}/fields
- 返回值datas: List<Map<String, Object>>,具体参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/meta/vbase_organization/v_sys_User/fields
3. 查询记录
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/findById
- 请求参数:
id
,以key-value
方式或以json
放在body
里的方式都兼容支持 - 返回值datas: List<Map<String, Object>>,具体参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/
findById?id=8a819aaf86beab580186c02046834303
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/find
- 请求参数:参考下图
- 返回值datas: List<Map<String, Object>>,具体参考下图
(1)请求参数
(2)返回值
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/find?
pageNumber=1&pageSize=10&fields=userNo,userName,sex,orderNo&filters=
[{"logical":"and","field":"orderNo","operator":"isnotnull","value":""},
{"logical":"or","field":"userNo","operator":"eq","value":"zs_ca0002"},
"logical":"or","field":"userNo","operator":"eq","value":"ls_820005"}]
4. 创建记录
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/create
- 请求参数:参考下图
- 返回值datas: 参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/create?
data={"id":"297e166986fe2a280186fe2b30e00eee","enableFlag":true,"mobile":"13450479666","userNo":"tao11",
"userName":"陶11","sex":"男","isAdmin":false,"orderNo":1}
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/batchCreate
- 请求参数:参考下图
- 返回值datas: 参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/batchCreate?
datas=[
{"id":"297e166986fe2a280186fe2b30e00aaa","enableFlag":true,"mobile":"13450479222","userNo":"tao22",
"userName":"陶22","sex":"男","isAdmin":false,"orderNo":2},
{"id":"297e166986fe2a280186fe2b30e00bbb","enableFlag":true,"mobile":"13450479333","userNo":"tao33",
"userName":"陶33","sex":"男","isAdmin":false,"orderNo":3}]
5. 更新记录
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/update
- 请求参数:参考下图
- 返回值datas: 参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/update?
data={"id":"297e166986fe2a280186fe2b30e00eee","mobile":"13711111111"}
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/batchUpdate
- 请求参数:参考下图
- 返回值datas: 参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/batchUpdate?
datas=[
{"id":"297e166986fe2a280186fe2b30e00aaa","enableFlag":true,"mobile":"13400000000","userNo":"tao22",
"userName":"陶22","sex":"女","isAdmin":false,"orderNo":2},
"id":"297e166986fe2a280186fe2b30e00bbb","enableFlag":true,"mobile":"13422222222","userNo":"tao33",
"userName":"陶33","sex":"女","isAdmin":false,"orderNo":3}]
6. 删除记录
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/delete
- 请求参数:参考下图
- 返回值datas: 参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/delete?
id=297e166986fe2a280186fe2b30e00eee
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/batchDelete
- 请求参数:参考下图
- 返回值datas: 参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/batchDelete?
datas=[{"id":"297e166986fe2a280186fe2b30e00aaa"},{"id":"297e166986fe2a280186fe2b30e00bbb"}]
7. 新增或更新记录
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/insertOrUpdate
- 请求参数:id、data,具体参考下图
- 返回值datas: id、saveType,具体参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/insertOrUpdate?
data={"id":"297e166986fe2a280186fe2b30e00eee","enableFlag":true,"mobile":"13450479666",
"userNo":"tao11","userName":"陶111","sex":"女","isAdmin":false,"orderNo":1}
- Http Method:兼容
Get
和Post
- Http Path:
/restapi/bizentity/data/{构件编码}/{业务表名}/batchInsertOrUpdate
- 请求参数:datas、isIgnoreEmptyId,具体参考下图
- 返回值datas: insertDatas、updateDatas,具体参考下图
例如:
http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/batchInsertOrUpdate?
datas=[
{"id":"297e166986fe2a280186fe2b30e00aaa","enableFlag":true,"mobile":"13450479222","userNo":"tao22",
"userName":"陶222","sex":"男","isAdmin":false,"orderNo":2},
{"id":"297e166986fe2a280186fe2b30e00bbb","enableFlag":true,"mobile":"13450479333","userNo":"tao33",
"userName":"陶333","sex":"男","isAdmin":false,"orderNo":3}]