定时任务服务接口说明
2023年1月14日大约 2 分钟
定时任务服务接口说明
定时任务服务名称
scheduled-task-service接口说明
提示
尚不清楚参数内容,请移步这里
- 新增定时任务
接口地址:/scheduledTask/
方法类型:post
请求体:
{
"openState":0,
"taskName":"生产环境定时任务测试",
"taskType":"dataAlert",
"businessCode":"pro",
"cornConfig":"0 */1 * * * ?",
"executeType":"sql",
"executeStructure":"select * from sys_base_user where id = 1",
"processingType":"message",
"processingStructure":"{\r\n \"messageType\":[\r\n \"inMail\",\r\n \"enterpriseMailbox\",\r\n \"dingding\",\r\n \"weixin\"\r\n ],\r\n \"userIds\":[\r\n \"111111\",\r\n \"222222\"\r\n ],\r\n \"messageContent\":\"这是消息内容\"\r\n,,\r\n \"messageTitle\":\"消息标题\"\r\n}"
}注:所有参数均为必须参数,包含消息处理体里的消息参数(数据预警)。
返回参数:
{
"code": 0,
"msg": "成功",
"data": {
"id": 1,
"taskCode":"1erg2ojo3sojd4jsoj",
"openState":0,
"taskName":"生产环境定时任务测试",
"taskType":"dataAlert",
"businessCode":"pro",
"cornConfig":"0 */1 * * * ?",
"executeType":"sql",
"executeStructure":"select * from sys_base_user where id = 1",
"processingType":"message",
"processingStructure":"{\r\n \"messageType\":[\r\n \"inMail\",\r\n \"enterpriseMailbox\",\r\n \"dingding\",\r\n \"weixin\"\r\n ],\r\n \"userIds\":[\r\n \"111111\",\r\n \"222222\"\r\n ],\r\n \"messageContent\":\"这是消息内容\"\r\n,,\r\n \"messageTitle\":\"消息标题\"\r\n}",
},
"ok": true
}- 修改定时任务
接口地址:/scheduledTask/
方法类型:put
路径参数:定时任务id
请求体:
{
"openState":0,
"taskName":"生产环境定时任务测试",
"taskType":"dataAlert",
"businessCode":"pro",
"cornConfig":"0 */1 * * * ?",
"executeType":"sql",
"executeStructure":"select * from sys_base_user where id = 1",
"processingType":"message",
"processingStructure":"{\r\n \"messageType\":[\r\n \"inMail\",\r\n \"enterpriseMailbox\",\r\n \"dingding\",\r\n \"weixin\"\r\n ],\r\n \"userIds\":[\r\n \"111111\",\r\n \"222222\"\r\n ],\r\n \"messageContent\":\"这是消息内容\"\r\n,,\r\n \"messageTitle\":\"消息标题\"\r\n}"
}- 删除定时任务
接口地址:/scheduledTask/
方法类型:delete
路径参数:定时任务id
- 获取定时任务详情
接口地址:/scheduledTask/
方法类型:get
路径参数:定时任务id
返回参数:
{
"code": 0,
"msg": "成功",
"data": {
"id": 1,
"taskCode":"1erg2ojo3sojd4jsoj",
"openState":0,
"taskName":"生产环境定时任务测试",
"taskType":"dataAlert",
"businessCode":"pro",
"cornConfig":"0 */1 * * * ?",
"executeType":"sql",
"executeStructure":"select * from sys_base_user where id = 1",
"processingType":"message",
"processingStructure":"{\r\n \"messageType\":[\r\n \"inMail\",\r\n \"enterpriseMailbox\",\r\n \"dingding\",\r\n \"weixin\"\r\n ],\r\n \"userIds\":[\r\n \"111111\",\r\n \"222222\"\r\n ],\r\n \"messageContent\":\"这是消息内容\"\r\n,,\r\n \"messageTitle\":\"消息标题\"\r\n}"
},
"ok": true
}