20190816-任务调度后台接口.md 3.21 KB

996.icu

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": "operation@boxfish.cn",
    "fileName": "导出文件",
    "mailList": "zhangwang@boxfish.cn,huayandong@boxfish.cn",
    "cron": "30 0/1 8-20 * * ?",
    "scriptUpdate": null,
    "scriptQuery": null
}

operatorAccount:当前记录 操作人账号
operation:当前定时任务 创建人账号
fileName:邮件附件名称
mailList:收件人名称,多个收件人之间使用 英文逗号","间隔开,收件人邮箱必须要@boxfish.cn结尾才能发邮件,否则不发邮件
cron:定时任务执行时间配置
scriptUpdate:SQL脚本 更新脚本
scriptQuery:SQL脚本 查询脚本

5. 【网页接口】编辑定时任务记录
  • URL: {{localhost}}/boxfish-data-market/market/scheduleJob/editScheduleJob
  • Method: POST
  • RequestBody
{
    "operatorAccount": "operatorAccount@b.cn",

    "taskId": 5,
    "operation": "operation@boxfish.cn",
    "fileName": "导出文件",
    "mailList": "zhangwang@boxfish.cn,huayandong@boxfish.cn",
    "cron": "30 0/1 8-20 * * ?",
    "scriptUpdate": null,
    "scriptQuery": null
}