diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java index b0a4027524..93f1ade633 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java @@ -251,20 +251,20 @@ public class TestPlanController { testPlanService.editReport(testPlanWithBLOBs); } - @PostMapping(value = "/schedule/updateEnableByPrimyKey") + @PostMapping(value = "/schedule/update/enable") public Schedule updateScheduleEnableByPrimyKey(@RequestBody ScheduleInfoRequest request) { Schedule schedule = baseScheduleService.getSchedule(request.getTaskID()); schedule.setEnable(request.isEnable()); - planApiAutomationService.updateSchedule(schedule); + testPlanService.updateSchedule(schedule); return schedule; } - @PostMapping(value = "/schedule/updateEnableByPrimyKey/disable") + @PostMapping(value = "/schedule/update/disable") @SendNotice(taskType = NoticeConstants.TaskType.TRACK_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, subject = "测试跟踪通知") public Schedule disableSchedule(@RequestBody ScheduleInfoRequest request) { Schedule schedule = baseScheduleService.getSchedule(request.getTaskID()); schedule.setEnable(false); - planApiAutomationService.updateSchedule(schedule); + testPlanService.updateSchedule(schedule); return schedule; } diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java index 709bdbf371..a65c5bbe05 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java @@ -1578,7 +1578,7 @@ public class TestPlanService { for (String id : scheduleIds) { Schedule schedule = baseScheduleService.getSchedule(id); schedule.setEnable(request.isEnable()); - planApiAutomationService.updateSchedule(schedule); + updateSchedule(schedule); } } diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/remote/api/PlanApiAutomationService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/remote/api/PlanApiAutomationService.java index fc62226909..fa9d772a36 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/remote/api/PlanApiAutomationService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/remote/api/PlanApiAutomationService.java @@ -1,12 +1,9 @@ package io.metersphere.plan.service.remote.api; import io.metersphere.base.domain.ApiScenarioWithBLOBs; -import io.metersphere.base.domain.Schedule; import io.metersphere.dto.MsExecResponseDTO; import io.metersphere.plan.reuest.api.RunScenarioRequest; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PathVariable; import java.util.List; @@ -21,10 +18,6 @@ public class PlanApiAutomationService extends ApiTestService { return microService.postForDataArray(serviceName, BASE_UEL + "/plan/run", request, MsExecResponseDTO.class); } - public void updateSchedule(Schedule request) { - microService.postForData(serviceName, BASE_UEL + "/schedule/update", request); - } - public ApiScenarioWithBLOBs get(@PathVariable String id) { return microService.getForData(serviceName, BASE_UEL + "/get/" + id, ApiScenarioWithBLOBs.class); } diff --git a/test-track/frontend/src/api/remote/plan/test-plan.js b/test-track/frontend/src/api/remote/plan/test-plan.js index b8916a1fcd..ba72d5d5d8 100644 --- a/test-track/frontend/src/api/remote/plan/test-plan.js +++ b/test-track/frontend/src/api/remote/plan/test-plan.js @@ -250,11 +250,11 @@ export function getPlanUiScenarioAllCase(planId, param) { } export function updatePlanSchedule(param) { - return post(BASE_URL + 'schedule/updateEnableByPrimyKey/disable', param); + return post(BASE_URL + 'schedule/update/disable', param); } export function updateScheduleEnableByPrimyKey(param) { - return post(BASE_URL + 'schedule/updateEnableByPrimyKey', param); + return post(BASE_URL + 'schedule/update/enable', param); }