feat: 消息设置内容修改

This commit is contained in:
wenyann 2020-10-29 18:35:07 +08:00
parent 9b07c26e05
commit 12387c9253
3 changed files with 13 additions and 10 deletions

View File

@ -183,13 +183,13 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
if (StringUtils.equals(NoticeConstants.API, report.getTriggerMode())) { if (StringUtils.equals(NoticeConstants.API, report.getTriggerMode())) {
MessageSettingDetail messageSettingDetail = noticeService.searchMessage(); MessageSettingDetail messageSettingDetail = noticeService.searchMessage();
taskList = messageSettingDetail.getJenkinsTask(); taskList = messageSettingDetail.getJenkinsTask();
successContext = "jenkins任务通知:'" + report.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url; successContext = "ApiJenkins任务通知:'" + report.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
failedContext = "jenkins任务通知:'" + report.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url; failedContext = "ApiJenkins任务通知:'" + report.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
} }
if (StringUtils.equals(NoticeConstants.SCHEDULE, report.getTriggerMode())) { if (StringUtils.equals(NoticeConstants.SCHEDULE, report.getTriggerMode())) {
taskList = noticeService.searchMessageSchedule(testResult.getTestId()); taskList = noticeService.searchMessageSchedule(testResult.getTestId());
successContext = "定时任务通知:'" + report.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url; successContext = "Api定时任务通知:'" + report.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
failedContext = "定时任务通知:'" + report.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url; failedContext = "Api定时任务通知:'" + report.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
} }
String finalSuccessContext = successContext; String finalSuccessContext = successContext;
String finalFailedContext = failedContext; String finalFailedContext = failedContext;

View File

@ -73,11 +73,11 @@ public class PerformanceNoticeTask {
if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode())) { if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode())) {
MessageSettingDetail messageSettingDetail = noticeService.searchMessage(); MessageSettingDetail messageSettingDetail = noticeService.searchMessage();
taskList = messageSettingDetail.getJenkinsTask(); taskList = messageSettingDetail.getJenkinsTask();
successContext = "jenkins性能测试任务通知" + loadTestReport.getName() + "执行成功" + "请点击下面链接进入测试报告页面" + url; successContext = "LoadJenkins任务通知:" + loadTestReport.getName() + "执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
} }
if (StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) { if (StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) {
taskList = noticeService.searchMessageSchedule(loadTestReport.getId()); taskList = noticeService.searchMessageSchedule(loadTestReport.getTestId());
successContext = "定时任务性能测试任务通知" + loadTestReport.getName() + "执行成功" + "请点击下面链接进入测试报告页面" + url; successContext = "Load定时任务通知:" + loadTestReport.getName() + "执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
} }
String finalSuccessContext = successContext; String finalSuccessContext = successContext;
taskList.forEach(r -> { taskList.forEach(r -> {
@ -112,11 +112,11 @@ public class PerformanceNoticeTask {
if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode())) { if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode())) {
MessageSettingDetail messageSettingDetail = noticeService.searchMessage(); MessageSettingDetail messageSettingDetail = noticeService.searchMessage();
taskList = messageSettingDetail.getJenkinsTask(); taskList = messageSettingDetail.getJenkinsTask();
failedContext = "jenkins性能测试任务通知" + loadTestReport.getName() + "执行失败" + "请点击下面链接进入测试报告页面" + url; failedContext = "LoadJenkins任务通知:" + loadTestReport.getName() + "执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
} }
if (StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) { if (StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) {
taskList = noticeService.searchMessageSchedule(loadTestReport.getId()); taskList = noticeService.searchMessageSchedule(loadTestReport.getTestId());
failedContext = "定时任务性能测试任务通知" + loadTestReport.getName() + "执行失败" + "请点击下面链接进入测试报告页面" + url; failedContext = "Load定时任务通知:" + loadTestReport.getName() + "执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
} }
String finalFailedContext = failedContext; String finalFailedContext = failedContext;
taskList.forEach(r -> { taskList.forEach(r -> {

View File

@ -233,6 +233,9 @@ public class PerformanceTestService {
if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode()) || StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) { if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode()) || StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) {
performanceNoticeTask.registerNoticeTask(loadTestReport); performanceNoticeTask.registerNoticeTask(loadTestReport);
} }
/*if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode()) || StringUtils.equals(NoticeConstants.SCHEDULE, "SCHEDULE")) {
performanceNoticeTask.registerNoticeTask(loadTestReport);
}*/
return engine.getReportId(); return engine.getReportId();
} }