| | |
| | | /** |
| | | * 查询定时任务列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:list')") |
| | | // @PreAuthorize("@ss.hasPermi('monitor:job:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysJob sysJob) |
| | | { |
| | |
| | | /** |
| | | * 导出定时任务列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:export')") |
| | | // @PreAuthorize("@ss.hasPermi('monitor:job:export')") |
| | | @Log(title = "定时任务", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(SysJob sysJob) |
| | |
| | | /** |
| | | * 获取定时任务详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:query')") |
| | | // @PreAuthorize("@ss.hasPermi('monitor:job:query')") |
| | | @GetMapping(value = "/{jobId}") |
| | | public AjaxResult getInfo(@PathVariable("jobId") Long jobId) |
| | | { |
| | |
| | | /** |
| | | * 新增定时任务 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:add')") |
| | | // @PreAuthorize("@ss.hasPermi('monitor:job:add')") |
| | | @Log(title = "定时任务", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException |
| | |
| | | /** |
| | | * 修改定时任务 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:edit')") |
| | | // @PreAuthorize("@ss.hasPermi('monitor:job:edit')") |
| | | @Log(title = "定时任务", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException |
| | | { |
| | | if (!CronUtils.isValid(job.getCronExpression())) |
| | |
| | | /** |
| | | * 定时任务状态修改 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") |
| | | // @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") |
| | | @Log(title = "定时任务", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | @PostMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException |
| | | { |
| | | SysJob newJob = jobService.selectJobById(job.getJobId()); |
| | |
| | | /** |
| | | * 定时任务立即执行一次 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") |
| | | // @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") |
| | | @Log(title = "定时任务", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/run") |
| | | @PostMapping("/run") |
| | | public AjaxResult run(@RequestBody SysJob job) throws SchedulerException |
| | | { |
| | | jobService.run(job); |
| | |
| | | /** |
| | | * 删除定时任务 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:remove')") |
| | | // @PreAuthorize("@ss.hasPermi('monitor:job:remove')") |
| | | @Log(title = "定时任务", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{jobIds}") |
| | | @GetMapping("/remove/{jobIds}") |
| | | public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException |
| | | { |
| | | jobService.deleteJobByIds(jobIds); |