From 0684fe63122cfe4605351457ef68c4c44d493e50 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 26 Aug 2021 10:12:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=80=9A=E7=9F=A5=20--bug?= =?UTF-8?q?=3D1006010=20--user=3D=E5=88=98=E7=91=9E=E6=96=8C=20=E3=80=90?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E3=80=91=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B5=8B=E8=AF=95...=20https://www.tapd.cn/55049933/s/1040372?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/controller/APITestController.java | 10 +++++++++- .../track/controller/TestPlanController.java | 10 +++++++++- .../api/homepage/components/RunningTaskList.vue | 2 +- .../track/home/components/RunningTaskList.vue | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) 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(); }); },