Skip to main content

restfulApi管理配置

1. 功能介绍

info
  • restfulApi操作类型:创建记录、更新记录、删除记录、查询记录、新增或更新记录
  • 执行系统版本要求:最新版本(2023.05.30后升级的)
  • restfulApi管理配置: 使用restfulApi功能前,需要设置为true

访问目录:配置中心 → 系统高级配置 → 系统维护 → 配置管理

img

img

2. 查询表结构

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/meta/{构件编码}/{业务表名}/fields
  • 返回值datas: List<Map<String, Object>>,具体参考下图

img

例如:

http://127.0.0.1:8080/restapi/bizentity/meta/vbase_organization/v_sys_User/fields

img

3. 查询记录

3.1 查询单条

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/findById
  • 请求参数:id ,以 key-value 方式或以 json 放在 body 里的方式都兼容支持
  • 返回值datas: List<Map<String, Object>>,具体参考下图

img

例如:

http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/
findById?id=8a819aaf86beab580186c02046834303

img

3.2 批量查询

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/find
  • 请求参数:参考下图
  • 返回值datas: List<Map<String, Object>>,具体参考下图

(1)请求参数

img

(2)返回值

img

例如:

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"}]

img

4. 创建记录

4.1 单条创建

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/create
  • 请求参数:参考下图
  • 返回值datas: 参考下图

img

例如:

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}

img

4.2 批量创建

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/batchCreate
  • 请求参数:参考下图
  • 返回值datas: 参考下图

img

例如:

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}]

img

5. 更新记录

5.1 单条更新

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/update
  • 请求参数:参考下图
  • 返回值datas: 参考下图

img

例如:

http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/update?
data={"id":"297e166986fe2a280186fe2b30e00eee","mobile":"13711111111"}

img

5.2 批量更新

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/batchUpdate
  • 请求参数:参考下图
  • 返回值datas: 参考下图

img

例如:

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}]

img

6. 删除记录

6.1 单条删除

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/delete
  • 请求参数:参考下图
  • 返回值datas: 参考下图

img

例如:

http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/delete?
id=297e166986fe2a280186fe2b30e00eee

img

6.2 批量删除

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/batchDelete
  • 请求参数:参考下图
  • 返回值datas: 参考下图

img

例如:

http://127.0.0.1:8080/restapi/bizentity/data/vbase_organization/v_sys_User/batchDelete?
datas=[{"id":"297e166986fe2a280186fe2b30e00aaa"},{"id":"297e166986fe2a280186fe2b30e00bbb"}]

img

7. 新增或更新记录

7.1 单条记录

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/insertOrUpdate
  • 请求参数:id、data,具体参考下图
  • 返回值datas: id、saveType,具体参考下图

img

例如:

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}

img

7.2 多条记录

  • Http Method:兼容 GetPost
  • Http Path:/restapi/bizentity/data/{构件编码}/{业务表名}/batchInsertOrUpdate
  • 请求参数:datas、isIgnoreEmptyId,具体参考下图
  • 返回值datas: insertDatas、updateDatas,具体参考下图

img

img

例如:

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}]

img