瀏覽代碼

调度系统接口文档

wudla 4 年之前
父節點
當前提交
f3fca9161a
共有 1 個文件被更改,包括 256 次插入0 次删除
  1. 256 0
      api document/scheduler_Api.md

+ 256 - 0
api document/scheduler_Api.md

@@ -0,0 +1,256 @@
+# 任务调度Api
+
+## 接口简介
+
+任务调度系统的CRUD与回调接口
+
+## 接口详情
+
+### 数据结构
+
+| 任务调度配置 |          |      |                                          |        |                                          |
+| ------------ | -------- | ---- | ---------------------------------------- | ------ | ---------------------------------------- |
+| 参数名       | 类型     | 必填 | 描述                                     | 默认值 | 备注                                     |
+| id           | String   | Y    |                                          | UUID   | 新建时如果为空,则默认为UUID             |
+| groupCode    | String   |      | 所属集团编码                             |        |                                          |
+| appCode      | String   |      | 应用编码                                 |        |                                          |
+| projectId    | String   |      | 项目ID                                   |        |                                          |
+| code         | String   | Y    | 任务编码                                 |        |                                          |
+| name         | String   | Y    | 任务名称                                 |        |                                          |
+| type         | String   | Y    | 执行方式                                 |        | http 或者 jms                            |
+| config       | Json     | Y    | 执行方式配置参数                         |        |                                          |
+| params       | Json     | Y    | 调起参数                                 |        |                                          |
+| timeRule     | Json     | Y    | 调起频率                                 |        |                                          |
+| startTime    | datetime |      | 开始时间                                 |        |                                          |
+| endTime      | datetime |      | 结束时间                                 |        |                                          |
+| responseTime | datetime | Y    | 任务接口的处理时长,用于任务启停消峰控制 |        | 任务接口的处理时长,用于任务启停消峰控制 |
+| level        | String   | Y    | 优先级                                   |        | 用于任务启停消峰控制                     |
+| remark       | String   |      | 备注                                     |        |                                          |
+
+##### 字段保存格式规则说明
+
+```json
+time_rule
+{
+  "cron": ""
+}
+
+config:
+{
+  "queue": "",
+  "exchange": "",
+  "routing": ""
+}
+
+params
+{
+  "": ""
+}
+```
+
+### 查询
+
+通用查询:
+
+### 新增
+
+##### 请求方法:POST
+
+##### 请求路径:/task/cfg/create
+
+##### 请求参数:
+
+```json
+{
+    "id":"123456",
+    "groupCode": "1",
+    "appCode": "2",
+    "projectId": "123",
+    "code": "456",
+    "name": "QKZZ",
+    "type": "JMS",
+    "config": {
+        "queue": "",
+        "exchange": "",
+        "routing": ""
+    },
+    "params": {
+        "test":"123"
+    },
+    "timeRule": {
+        "cron": "0 0/1 * * * ?"
+    },
+    "startTime": "1600167750640",
+    "endTime": "1600167750640",
+    "responseTime": 500,
+    "level": "10",
+    "remark": "测试"
+}
+```
+
+##### 返回结果:
+
+正确JSON示例
+
+```json
+{
+    "result": "success",
+    "message": null,
+    "data": {
+        "id": "123456"
+    }
+}
+```
+
+错误JSON示例
+
+```json
+{
+    "result": "success",
+    "message": "错误信息,如果接口发生错误会返回该字段"
+}
+```
+
+### 更新
+
+##### 请求方法:POST
+
+##### 请求路径:/task/cfg/update
+
+##### 请求参数:
+
+```json
+{
+    "id":"123456",
+    "groupCode": "1",
+    "appCode": "2",
+    "projectId": "123",
+    "code": "456",
+    "name": "QKZZ",
+    "type": "JMS",
+    "config": {
+        "queue": "",
+        "exchange": "",
+        "routing": ""
+    },
+    "params": {
+        "test":"123"
+    },
+    "timeRule": {
+        "cron": "0 0/1 * * * ?"
+    },
+    "startTime": "1600167750640",
+    "endTime": "1600167750640",
+    "responseTime": 500,
+    "level": "10",
+    "remark": "测试"
+}
+```
+
+##### 返回结果:
+
+正确JSON示例
+
+```json
+{
+    "result": "success",
+    "message": null,
+    "data": {
+        "id": "c51a599e-e833-4088-911a-8b535bddfe0b"
+    }
+}
+```
+
+错误JSON示例
+
+```json
+{
+    "timestamp": "2020-09-28T14:17:08.274+0000",
+    "status": 500,
+    "error": "",
+    "message": "",
+    "path": "/task/cfg/update"
+}
+```
+
+### 删除
+
+##### 请求方法:POST
+
+##### 请求路径:/task/cfg/delete
+
+##### 请求参数:
+
+```json
+{
+	"id": "12345"
+}
+```
+
+##### 返回结果:
+
+正确JSON示例
+
+```json
+{
+    "result": "success",
+    "message": null,
+    "data": null
+}
+```
+
+错误JSON示例
+
+```json
+{
+    "timestamp": "2020-09-28T14:16:24.900+0000",
+    "status": 500,
+    "error": "Internal Server Error",
+    "message": "No class com.persagy.dmp.dpt.entity.TaskCfg entity with id 1234567 exists!",
+    "path": "/task/cfg/delete"
+}
+```
+
+### 回调接口
+
+##### 请求方法:POST
+
+##### 请求路径:/task/cfg/receive
+
+##### 请求参数:
+
+```json
+["1","2"]
+```
+
+##### 返回结果:
+
+正确JSON示例
+
+```json
+{
+    "result": "success",
+    "message": null,
+    "data": null
+}
+```
+
+错误JSON示例
+
+```json
+{
+    "timestamp": "2020-09-28T14:16:24.900+0000",
+    "status": 500,
+    "error": "Internal Server Error",
+    "message": "No class com.persagy.dmp.dpt.entity.TaskCfg entity with id 1234567 exists!",
+    "path": "/task/cfg/delete"
+}
+```
+
+### 备注说明
+
+无
+
+### 修改日志
+
+见git提交记录