[ server ] [ execution ]- optimize some controller - 2

This commit is contained in:
zeaslity
2023-01-16 18:02:36 +08:00
parent 41396e024c
commit 4812756408
6 changed files with 100 additions and 81 deletions

View File

@@ -5,8 +5,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.wdd.common.beans.response.R;
import io.wdd.rpc.scheduler.config.UpdateJobBean;
import io.wdd.rpc.scheduler.service.QuartzSchedulerService;
import org.quartz.Trigger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -38,7 +38,7 @@ public class SchedulerController {
}
@ApiOperation(value = "删除一个job")
@PostMapping(value = "/deleteJob/{jobName}")
@PostMapping(value = "/deleteJob/")
public R<String> deleteJob(
@ApiParam(name = "jobName") @RequestParam("jobName") String jobName
) {
@@ -64,13 +64,25 @@ public class SchedulerController {
@ApiOperation(value = "修改job的cron时间")
@PostMapping(value = "/updateJob/{jobName}")
public void deleteJob(
@ApiParam(name = "jobName") @PathVariable("jobName") String jobName, @ApiParam(name = "jobCronTime") @RequestBody UpdateJobBean updateJobBean
@ApiParam(name = "jobName") @RequestParam("jobName") String jobName,
@ApiParam(name = "jobCronTime") @RequestParam("jobCronTime") String jobCronTime
) {
octopusQuartzService.updateJob(
jobName,
jobName,
updateJobBean.getJobCronTime()
jobCronTime
);
}
@ApiOperation(value = "查询所有的触发器Trigger")
@GetMapping(value = "/allTriggers")
public R<List<Trigger>> queryAllTriggers() {
return R.ok(
octopusQuartzService.queryAllTrigger()
);
}