20190816-任务调度后台接口.md
2.63 KB
1. 【网页接口】查询全部定时任务列表接口
- URL: {{localhost}}/boxfish-data-market/market/scheduleJob/getScheduleJobList
- Method: POST
- RequestBody
{
"pageSize": 40,
"pageId": 0,
"operator": "zzz@boxfish.cn" // 查询条件:登记定时任务的人
}
- ResponseBody:
{
"status": "SUCCESS",
"totalCount": 8,
"totalPage": 2,
"list": [
{
"taskId": 3,
"operator": "xxx@boxfish.cn",
"fileName": "这是一个测试任务:Test3",
"mailList": "huayandong@boxfish.cn",
"cron": "20 0/1 8-20 * * ?",
"flagEnable": true,
"scriptUpdate": "script_update",
"scriptQuery": "script_query"
},
{
"taskId": 4,
"operator": "xxx@boxfish.cn",
"fileName": "这是一个测试任务:Test4",
"mailList": "huayandong@boxfish.cn",
"cron": "30 0/1 8-20 * * ?",
"flagEnable": false,
"scriptUpdate": "script_update",
"scriptQuery": "script_query"
}
]
}
2. 【网页接口】删除定时任务
- URL: {{localhost}}/boxfish-data-market/market/scheduleJob/deleteSchedule
- Method: POST
- RequestBody
{
"operatorAccount": "xxx@b.cn", // 当前操作人账号
"taskId": 8
}
3. 【网页接口】更新指定定时任务状态
- URL: {{localhost}}/boxfish-data-market/market/scheduleJob/updateScheduleStatus
- Method: POST
- RequestBody
{
"operatorAccount": "xxx@b.cn", // 当前操作人账号
"taskId": 8,
"flagEnable": true
}
flagEnable
: 定时任务的状态,true
表示定时任务开始执行,false
表示定时任务停止执行
4. 【网页接口】增加一条定时任务记录
- URL: {{localhost}}/boxfish-data-market/market/scheduleJob/addScheduleJob
- Method: POST
- RequestBody
{
"operatorAccount": "operatorAccount@b.cn",
"operation": "abc@b.cn",
"fileName": "导出文件",
"mailList": "zhangwang@boxfish.cn,huayandong@boxfish.cn",
"cron": "30 0/1 8-20 * * ?",
"scriptUpdate": null,
"scriptQuery": null
}
operatorAccount
:当前记录 操作人账号operation
:当前定时任务 创建人账号fileName
:邮件附件名称mailList
:收件人名称,多个收件人之间使用 英文逗号","间隔开cron
:定时任务执行时间配置scriptUpdate
:SQL脚本 更新脚本scriptQuery
:SQL脚本 查询脚本