diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index 9cdd015ef2..e6d8d7fa0e 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -365,7 +365,6 @@ public class APITestController { } @PostMapping(value = "/schedule/updateEnableByPrimyKey") - @SendNotice(taskType = NoticeConstants.TaskType.API_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, mailTemplate = "api/ScheduleClose", subject = "接口测试通知") public Schedule updateScheduleEnableByPrimyKey(@RequestBody ScheduleInfoRequest request) { Schedule schedule = scheduleService.getSchedule(request.getTaskID()); schedule.setEnable(request.isEnable()); @@ -373,6 +372,15 @@ public class APITestController { return schedule; } + @PostMapping(value = "/schedule/updateEnableByPrimyKey/disable") + @SendNotice(taskType = NoticeConstants.TaskType.API_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, mailTemplate = "api/ScheduleClose", subject = "接口测试通知") + public Schedule disableSchedule(@RequestBody ScheduleInfoRequest request) { + Schedule schedule = scheduleService.getSchedule(request.getTaskID()); + schedule.setEnable(false); + apiAutomationService.updateSchedule(schedule); + return schedule; + } + @PostMapping(value = "/historicalDataUpgrade") public String historicalDataUpgrade(@RequestBody SaveHistoricalDataUpgrade request) { return historicalDataUpgradeService.upgrade(request); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java index 6b57435ea8..86d889ccd3 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java @@ -234,11 +234,19 @@ public class TestPlanController { } @PostMapping(value = "/schedule/updateEnableByPrimyKey") - @SendNotice(taskType = NoticeConstants.TaskType.TRACK_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, mailTemplate = "track/ScheduleClose", subject = "测试跟踪通知") public Schedule updateScheduleEnableByPrimyKey(@RequestBody ScheduleInfoRequest request) { Schedule schedule = scheduleService.getSchedule(request.getTaskID()); schedule.setEnable(request.isEnable()); apiAutomationService.updateSchedule(schedule); return schedule; } + + @PostMapping(value = "/schedule/updateEnableByPrimyKey/disable") + @SendNotice(taskType = NoticeConstants.TaskType.TRACK_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, mailTemplate = "track/ScheduleClose", subject = "测试跟踪通知") + public Schedule disableSchedule(@RequestBody ScheduleInfoRequest request) { + Schedule schedule = scheduleService.getSchedule(request.getTaskID()); + schedule.setEnable(false); + apiAutomationService.updateSchedule(schedule); + return schedule; + } } diff --git a/frontend/src/business/components/api/homepage/components/RunningTaskList.vue b/frontend/src/business/components/api/homepage/components/RunningTaskList.vue index 3806f1cd60..9c914b30fa 100644 --- a/frontend/src/business/components/api/homepage/components/RunningTaskList.vue +++ b/frontend/src/business/components/api/homepage/components/RunningTaskList.vue @@ -146,7 +146,7 @@ export default { updateTask(taskRow){ - this.result = this.$post('/api/schedule/updateEnableByPrimyKey', taskRow, response => { + this.result = this.$post('/api/schedule/updateEnableByPrimyKey/disable', taskRow, response => { this.search(); }); }, diff --git a/frontend/src/business/components/track/home/components/RunningTaskList.vue b/frontend/src/business/components/track/home/components/RunningTaskList.vue index e9b9717def..e3f3c9eb91 100644 --- a/frontend/src/business/components/track/home/components/RunningTaskList.vue +++ b/frontend/src/business/components/track/home/components/RunningTaskList.vue @@ -146,7 +146,7 @@ export default { updateTask(taskRow){ - this.result = this.$post('/test/plan/schedule/updateEnableByPrimyKey', taskRow, response => { + this.result = this.$post('/test/plan/schedule/updateEnableByPrimyKey/disable', taskRow, response => { this.search(); }); },