fix: 修复首页定时任务通知 --bug=1006010 --user=刘瑞斌 【消息通知】接口测试... https://www.tapd.cn/55049933/s/1040372

This commit is contained in:
Captain.B 2021-08-26 10:12:35 +08:00 committed by 刘瑞斌
parent a5de0b85db
commit 0684fe6312
4 changed files with 20 additions and 4 deletions

View File

@ -365,7 +365,6 @@ public class APITestController {
} }
@PostMapping(value = "/schedule/updateEnableByPrimyKey") @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) { public Schedule updateScheduleEnableByPrimyKey(@RequestBody ScheduleInfoRequest request) {
Schedule schedule = scheduleService.getSchedule(request.getTaskID()); Schedule schedule = scheduleService.getSchedule(request.getTaskID());
schedule.setEnable(request.isEnable()); schedule.setEnable(request.isEnable());
@ -373,6 +372,15 @@ public class APITestController {
return schedule; 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") @PostMapping(value = "/historicalDataUpgrade")
public String historicalDataUpgrade(@RequestBody SaveHistoricalDataUpgrade request) { public String historicalDataUpgrade(@RequestBody SaveHistoricalDataUpgrade request) {
return historicalDataUpgradeService.upgrade(request); return historicalDataUpgradeService.upgrade(request);

View File

@ -234,11 +234,19 @@ public class TestPlanController {
} }
@PostMapping(value = "/schedule/updateEnableByPrimyKey") @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) { public Schedule updateScheduleEnableByPrimyKey(@RequestBody ScheduleInfoRequest request) {
Schedule schedule = scheduleService.getSchedule(request.getTaskID()); Schedule schedule = scheduleService.getSchedule(request.getTaskID());
schedule.setEnable(request.isEnable()); schedule.setEnable(request.isEnable());
apiAutomationService.updateSchedule(schedule); apiAutomationService.updateSchedule(schedule);
return 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;
}
} }

View File

@ -146,7 +146,7 @@ export default {
updateTask(taskRow){ updateTask(taskRow){
this.result = this.$post('/api/schedule/updateEnableByPrimyKey', taskRow, response => { this.result = this.$post('/api/schedule/updateEnableByPrimyKey/disable', taskRow, response => {
this.search(); this.search();
}); });
}, },

View File

@ -146,7 +146,7 @@ export default {
updateTask(taskRow){ 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(); this.search();
}); });
}, },