|
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
import com.ruoyi.framework.web.controller.BaseController;
|
|
|
-import com.ruoyi.framework.web.domain.JSON;
|
|
|
+import com.ruoyi.framework.web.domain.Message;
|
|
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
import com.ruoyi.project.monitor.job.domain.Job;
|
|
|
import com.ruoyi.project.monitor.job.service.IJobService;
|
|
@@ -56,35 +56,35 @@ public class JobController extends BaseController
|
|
|
@RequiresPermissions("monitor:job:remove")
|
|
|
@RequestMapping("/remove/{jobId}")
|
|
|
@ResponseBody
|
|
|
- public JSON remove(@PathVariable("jobId") Long jobId)
|
|
|
+ public Message remove(@PathVariable("jobId") Long jobId)
|
|
|
{
|
|
|
Job job = jobService.selectJobById(jobId);
|
|
|
if (job == null)
|
|
|
{
|
|
|
- return JSON.error("调度任务不存在");
|
|
|
+ return Message.error("调度任务不存在");
|
|
|
}
|
|
|
if (jobService.deleteJob(job) > 0)
|
|
|
{
|
|
|
- return JSON.ok();
|
|
|
+ return Message.ok();
|
|
|
}
|
|
|
- return JSON.error();
|
|
|
+ return Message.error();
|
|
|
}
|
|
|
|
|
|
@Log(title = "监控管理", action = "定时任务-批量删除")
|
|
|
@RequiresPermissions("monitor:job:batchRemove")
|
|
|
@PostMapping("/batchRemove")
|
|
|
@ResponseBody
|
|
|
- public JSON batchRemove(@RequestParam("ids[]") Long[] ids)
|
|
|
+ public Message batchRemove(@RequestParam("ids[]") Long[] ids)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
jobService.batchDeleteJob(ids);
|
|
|
- return JSON.ok();
|
|
|
+ return Message.ok();
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
e.printStackTrace();
|
|
|
- return JSON.error(e.getMessage());
|
|
|
+ return Message.error(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -95,13 +95,13 @@ public class JobController extends BaseController
|
|
|
@RequiresPermissions("monitor:job:changeStatus")
|
|
|
@PostMapping("/changeStatus")
|
|
|
@ResponseBody
|
|
|
- public JSON changeStatus(Job job)
|
|
|
+ public Message changeStatus(Job job)
|
|
|
{
|
|
|
if (jobService.changeStatus(job) > 0)
|
|
|
{
|
|
|
- return JSON.ok();
|
|
|
+ return Message.ok();
|
|
|
}
|
|
|
- return JSON.error();
|
|
|
+ return Message.error();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -135,12 +135,12 @@ public class JobController extends BaseController
|
|
|
@RequiresPermissions("monitor:job:save")
|
|
|
@PostMapping("/save")
|
|
|
@ResponseBody
|
|
|
- public JSON save(Job job)
|
|
|
+ public Message save(Job job)
|
|
|
{
|
|
|
if (jobService.saveJobCron(job) > 0)
|
|
|
{
|
|
|
- return JSON.ok();
|
|
|
+ return Message.ok();
|
|
|
}
|
|
|
- return JSON.error();
|
|
|
+ return Message.error();
|
|
|
}
|
|
|
}
|