From a63526ab2e310837d04bc20038c99e20ca85b4cd Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 18 Apr 2022 17:29:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5):?= =?UTF-8?q?=20=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E6=A8=A1?= =?UTF-8?q?=E7=89=88=EF=BC=8C=E5=88=A0=E9=99=A4html=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../APIScenarioReportController.java | 4 +- .../api/controller/APITestController.java | 2 +- .../controller/ApiAutomationController.java | 12 +++--- .../controller/ApiDefinitionController.java | 10 ++--- .../api/controller/ApiTestCaseController.java | 12 +++--- .../ApiDefinitionExecResultService.java | 2 - .../api/service/ApiDefinitionService.java | 2 - .../api/service/ApiScenarioReportService.java | 2 - .../api/service/TestResultService.java | 2 - .../notice/annotation/SendNotice.java | 10 ----- .../notice/sender/AbstractNoticeSender.java | 39 ------------------- .../AfterReturningNoticeSendService.java | 1 - .../notice/sender/NoticeModel.java | 7 ---- .../notice/sender/impl/MailNoticeSender.java | 2 +- .../PerformanceReportController.java | 4 +- .../controller/PerformanceTestController.java | 6 +-- .../notice/PerformanceNoticeEvent.java | 3 -- .../controller/IssueCommentController.java | 2 +- .../track/controller/IssuesController.java | 6 +-- .../controller/TestCaseCommentController.java | 2 +- .../track/controller/TestCaseController.java | 16 ++++---- .../controller/TestCaseReviewController.java | 8 ++-- .../track/controller/TestPlanController.java | 10 ++--- .../controller/TestPlanReportController.java | 2 +- .../track/service/TestCaseReviewService.java | 1 - .../resources/mail/ApiFailedNotification.html | 21 ---------- .../mail/ApiSuccessfulNotification.html | 18 --------- .../mail/PerformanceFailedNotification.html | 19 --------- .../mail/PerformanceSuccessNotification.html | 12 ------ .../main/resources/mail/ReviewComments.html | 16 -------- .../main/resources/mail/SwaggerImport.html | 15 ------- .../resources/mail/SwaggerImportFaild.html | 15 ------- .../mail/TestPlanFailedNotification.html | 21 ---------- .../mail/TestPlanSuccessfulNotification.html | 18 --------- .../resources/mail/api/AutomationCreate.html | 12 ------ .../resources/mail/api/AutomationDelete.html | 12 ------ .../resources/mail/api/AutomationUpdate.html | 12 ------ .../main/resources/mail/api/CaseCreate.html | 12 ------ .../main/resources/mail/api/CaseDelete.html | 12 ------ .../resources/mail/api/CaseResultFailed.html | 12 ------ .../resources/mail/api/CaseResultSuccess.html | 12 ------ .../main/resources/mail/api/CaseUpdate.html | 12 ------ .../resources/mail/api/DefinitionCreate.html | 12 ------ .../resources/mail/api/DefinitionDelete.html | 12 ------ .../resources/mail/api/DefinitionUpdate.html | 12 ------ .../main/resources/mail/api/ReportDelete.html | 12 ------ .../mail/api/ScenarioResultFailed.html | 12 ------ .../mail/api/ScenarioResultSuccess.html | 12 ------ .../resources/mail/api/ScheduleClose.html | 12 ------ .../mail/performance/ReportDelete.html | 12 ------ .../mail/performance/TestCreate.html | 12 ------ .../mail/performance/TestDelete.html | 12 ------ .../mail/performance/TestResult.html | 12 ------ .../mail/performance/TestUpdate.html | 12 ------ .../mail/track/IssuesCommentUpdate.html | 12 ------ .../resources/mail/track/IssuesCreate.html | 12 ------ .../resources/mail/track/IssuesDelete.html | 12 ------ .../resources/mail/track/IssuesUpdate.html | 12 ------ .../resources/mail/track/ReportDelete.html | 12 ------ .../resources/mail/track/ReviewDelete.html | 12 ------ .../main/resources/mail/track/ReviewEnd.html | 14 ------- .../resources/mail/track/ReviewInitiate.html | 14 ------- .../resources/mail/track/ReviewUpdate.html | 14 ------- .../resources/mail/track/ScheduleClose.html | 12 ------ .../resources/mail/track/TestCaseComment.html | 16 -------- .../resources/mail/track/TestCaseCreate.html | 16 -------- .../resources/mail/track/TestCaseDelete.html | 16 -------- .../resources/mail/track/TestCaseUpdate.html | 16 -------- .../mail/track/TestPlanComplete.html | 12 ------ .../resources/mail/track/TestPlanDelete.html | 12 ------ .../resources/mail/track/TestPlanStart.html | 12 ------ .../resources/mail/track/TestPlanUpdate.html | 12 ------ .../schedule/ScheduleNotification.vue | 20 +--------- .../import/SwaggerTaskNotification.vue | 20 +--------- .../notification/ScheduleTaskNotification.vue | 20 +--------- .../api/ApiAutomationNotification.vue | 22 +---------- .../api/ApiDefinitionNotification.vue | 27 +------------ .../notification/api/ApiHomeNotification.vue | 16 +------- .../api/ApiReportNotification.vue | 16 +------- .../jenkins/JenkinsNotification.vue | 17 +------- .../PerformanceReportNotification.vue | 16 +------- .../PerformanceTestNotification.vue | 20 +--------- .../track/DefectTaskNotification.vue | 18 +-------- .../track/TestCaseNotification.vue | 19 +-------- .../track/TestPlanTaskNotification.vue | 21 +--------- .../track/TestReviewNotification.vue | 20 +--------- .../track/TrackHomeNotification.vue | 16 +------- .../track/TrackReportNotification.vue | 16 +------- .../plan/components/ScheduleNotification.vue | 21 +--------- 89 files changed, 66 insertions(+), 1059 deletions(-) delete mode 100644 backend/src/main/resources/mail/ApiFailedNotification.html delete mode 100644 backend/src/main/resources/mail/ApiSuccessfulNotification.html delete mode 100644 backend/src/main/resources/mail/PerformanceFailedNotification.html delete mode 100644 backend/src/main/resources/mail/PerformanceSuccessNotification.html delete mode 100644 backend/src/main/resources/mail/ReviewComments.html delete mode 100644 backend/src/main/resources/mail/SwaggerImport.html delete mode 100644 backend/src/main/resources/mail/SwaggerImportFaild.html delete mode 100644 backend/src/main/resources/mail/TestPlanFailedNotification.html delete mode 100644 backend/src/main/resources/mail/TestPlanSuccessfulNotification.html delete mode 100644 backend/src/main/resources/mail/api/AutomationCreate.html delete mode 100644 backend/src/main/resources/mail/api/AutomationDelete.html delete mode 100644 backend/src/main/resources/mail/api/AutomationUpdate.html delete mode 100644 backend/src/main/resources/mail/api/CaseCreate.html delete mode 100644 backend/src/main/resources/mail/api/CaseDelete.html delete mode 100644 backend/src/main/resources/mail/api/CaseResultFailed.html delete mode 100644 backend/src/main/resources/mail/api/CaseResultSuccess.html delete mode 100644 backend/src/main/resources/mail/api/CaseUpdate.html delete mode 100644 backend/src/main/resources/mail/api/DefinitionCreate.html delete mode 100644 backend/src/main/resources/mail/api/DefinitionDelete.html delete mode 100644 backend/src/main/resources/mail/api/DefinitionUpdate.html delete mode 100644 backend/src/main/resources/mail/api/ReportDelete.html delete mode 100644 backend/src/main/resources/mail/api/ScenarioResultFailed.html delete mode 100644 backend/src/main/resources/mail/api/ScenarioResultSuccess.html delete mode 100644 backend/src/main/resources/mail/api/ScheduleClose.html delete mode 100644 backend/src/main/resources/mail/performance/ReportDelete.html delete mode 100644 backend/src/main/resources/mail/performance/TestCreate.html delete mode 100644 backend/src/main/resources/mail/performance/TestDelete.html delete mode 100644 backend/src/main/resources/mail/performance/TestResult.html delete mode 100644 backend/src/main/resources/mail/performance/TestUpdate.html delete mode 100644 backend/src/main/resources/mail/track/IssuesCommentUpdate.html delete mode 100644 backend/src/main/resources/mail/track/IssuesCreate.html delete mode 100644 backend/src/main/resources/mail/track/IssuesDelete.html delete mode 100644 backend/src/main/resources/mail/track/IssuesUpdate.html delete mode 100644 backend/src/main/resources/mail/track/ReportDelete.html delete mode 100644 backend/src/main/resources/mail/track/ReviewDelete.html delete mode 100644 backend/src/main/resources/mail/track/ReviewEnd.html delete mode 100644 backend/src/main/resources/mail/track/ReviewInitiate.html delete mode 100644 backend/src/main/resources/mail/track/ReviewUpdate.html delete mode 100644 backend/src/main/resources/mail/track/ScheduleClose.html delete mode 100644 backend/src/main/resources/mail/track/TestCaseComment.html delete mode 100644 backend/src/main/resources/mail/track/TestCaseCreate.html delete mode 100644 backend/src/main/resources/mail/track/TestCaseDelete.html delete mode 100644 backend/src/main/resources/mail/track/TestCaseUpdate.html delete mode 100644 backend/src/main/resources/mail/track/TestPlanComplete.html delete mode 100644 backend/src/main/resources/mail/track/TestPlanDelete.html delete mode 100644 backend/src/main/resources/mail/track/TestPlanStart.html delete mode 100644 backend/src/main/resources/mail/track/TestPlanUpdate.html diff --git a/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java b/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java index 7e660a1722..217b1a384e 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java @@ -55,7 +55,7 @@ public class APIScenarioReportController { @PostMapping("/delete") @MsAuditLog(module = OperLogModule.API_AUTOMATION_REPORT, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = ApiScenarioReportService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_REPORT_TASK, event = NoticeConstants.Event.DELETE, target = "#targetClass.get(#request.id)", targetClass = ApiScenarioReportService.class, - mailTemplate = "api/ReportDelete", subject = "接口报告通知") + subject = "接口报告通知") public void delete(@RequestBody DeleteAPIReportRequest request) { apiReportService.delete(request); } @@ -63,7 +63,7 @@ public class APIScenarioReportController { @PostMapping("/batch/delete") @MsAuditLog(module = OperLogModule.API_AUTOMATION_REPORT, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#reportRequest.ids)", msClass = ApiScenarioReportService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_REPORT_TASK, event = NoticeConstants.Event.DELETE, target = "#targetClass.getByIds(#request.ids)", targetClass = ApiScenarioReportService.class, - mailTemplate = "api/ReportDelete", subject = "接口报告通知") + subject = "接口报告通知") public void deleteAPIReportBatch(@RequestBody APIReportBatchRequest request) { apiReportService.deleteAPIReportBatch(request); } 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 de7a527caf..7104e6538c 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -384,7 +384,7 @@ public class APITestController { } @PostMapping(value = "/schedule/updateEnableByPrimyKey/disable") - @SendNotice(taskType = NoticeConstants.TaskType.API_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, mailTemplate = "api/ScheduleClose", subject = "接口测试通知") + @SendNotice(taskType = NoticeConstants.TaskType.API_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, subject = "接口测试通知") public Schedule disableSchedule(@RequestBody ScheduleInfoRequest request) { Schedule schedule = scheduleService.getSchedule(request.getTaskID()); schedule.setEnable(false); diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java index 37dea75a75..0b692afceb 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -100,7 +100,7 @@ public class ApiAutomationController { @PostMapping(value = "/create") @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiAutomationService.class) @RequiresPermissions(value = {PermissionConstants.PROJECT_API_SCENARIO_READ_CREATE, PermissionConstants.PROJECT_API_SCENARIO_READ_COPY}, logical = Logical.OR) - @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, event = NoticeConstants.Event.CREATE, mailTemplate = "api/AutomationCreate", subject = "接口自动化通知") + @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, event = NoticeConstants.Event.CREATE, subject = "接口自动化通知") public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles", required = false) List bodyFiles, @RequestPart(value = "scenarioFiles", required = false) List scenarioFiles) { return apiAutomationService.create(request, bodyFiles, scenarioFiles); @@ -109,7 +109,7 @@ public class ApiAutomationController { @PostMapping(value = "/update") @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiAutomationService.class) @RequiresPermissions(value = {PermissionConstants.PROJECT_API_SCENARIO_READ_EDIT, PermissionConstants.PROJECT_API_SCENARIO_READ_COPY}, logical = Logical.OR) - @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "api/AutomationUpdate", subject = "接口自动化通知") + @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, event = NoticeConstants.Event.UPDATE, subject = "接口自动化通知") public ApiScenario update(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles", required = false) List bodyFiles, @RequestPart(value = "scenarioFiles", required = false) List scenarioFiles) { return apiAutomationService.update(request, bodyFiles, scenarioFiles); @@ -131,7 +131,7 @@ public class ApiAutomationController { @PostMapping("/deleteBatch") @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiAutomationService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, event = NoticeConstants.Event.DELETE, target = "#targetClass.getScenarioCaseByIds(#ids)", targetClass = ApiAutomationService.class, - mailTemplate = "api/AutomationUpdate", subject = "接口自动化通知") + subject = "接口自动化通知") public void deleteBatch(@RequestBody List ids) { apiAutomationService.deleteBatch(ids); } @@ -145,7 +145,7 @@ public class ApiAutomationController { @PostMapping("/removeToGc") @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiAutomationService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, target = "#targetClass.getApiScenarios(#ids)", targetClass = ApiAutomationService.class, - event = NoticeConstants.Event.DELETE, mailTemplate = "api/AutomationDelete", subject = "接口自动化通知") + event = NoticeConstants.Event.DELETE, subject = "接口自动化通知") public void removeToGc(@RequestBody List ids) { apiAutomationService.removeToGc(ids); } @@ -153,7 +153,7 @@ public class ApiAutomationController { @PostMapping("/removeToGcByBatch") @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.BATCH_GC, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, target = "#targetClass.getApiScenarios(#request.ids)", targetClass = ApiAutomationService.class, - event = NoticeConstants.Event.DELETE, mailTemplate = "api/AutomationDelete", subject = "接口自动化通知") + event = NoticeConstants.Event.DELETE, subject = "接口自动化通知") public void removeToGcByBatch(@RequestBody ApiScenarioBatchRequest request) { apiAutomationService.removeToGcByBatch(request); } @@ -238,7 +238,7 @@ public class ApiAutomationController { @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EDIT) @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.getLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, event = NoticeConstants.Event.UPDATE, target = "#targetClass.getScenarioCaseByIds(#request.ids)", targetClass = ApiAutomationService.class, - mailTemplate = "api/AutomationUpdate", subject = "接口自动化通知") + subject = "接口自动化通知") public void bathEdit(@RequestBody ApiScenarioBatchRequest request) { apiAutomationService.bathEdit(request); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java index 28a4f80848..860fc088f1 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java @@ -102,7 +102,7 @@ public class ApiDefinitionController { @PostMapping(value = "/create", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API) @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiDefinitionService.class) - @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CREATE, mailTemplate = "api/DefinitionCreate", subject = "接口定义通知") + @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CREATE, subject = "接口定义通知") public ApiDefinitionWithBLOBs create(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { checkPermissionService.checkProjectOwner(request.getProjectId()); return apiDefinitionService.create(request, bodyFiles); @@ -111,7 +111,7 @@ public class ApiDefinitionController { @PostMapping(value = "/update", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_EDIT_API) @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiDefinitionService.class) - @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "api/DefinitionUpdate", subject = "接口定义通知") + @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.UPDATE, subject = "接口定义通知") public ApiDefinitionWithBLOBs update(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { checkPermissionService.checkProjectOwner(request.getProjectId()); return apiDefinitionService.update(request, bodyFiles); @@ -150,7 +150,7 @@ public class ApiDefinitionController { @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API) @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiDefinitionService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, target = "#targetClass.getBLOBs(#ids)", targetClass = ApiDefinitionService.class, - event = NoticeConstants.Event.DELETE, mailTemplate = "api/DefinitionDelete", subject = "接口定义通知") + event = NoticeConstants.Event.DELETE, subject = "接口定义通知") public void removeToGc(@RequestBody List ids) { apiDefinitionService.removeToGc(ids); } @@ -159,7 +159,7 @@ public class ApiDefinitionController { @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API) @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.BATCH_GC, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiDefinitionService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.DELETE, target = "#targetClass.getBLOBs(#request.ids)", targetClass = ApiDefinitionService.class, - mailTemplate = "api/DefinitionUpdate", subject = "接口定义通知") + subject = "接口定义通知") public void removeToGcByParams(@RequestBody ApiBatchRequest request) { apiDefinitionService.removeToGcByParams(request); } @@ -274,7 +274,7 @@ public class ApiDefinitionController { @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_EDIT_API) @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.getLogDetails(#request)", content = "#msClass.getLogDetails(#request)", msClass = ApiDefinitionService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.UPDATE, target = "#targetClass.getBLOBs(#request.ids)", targetClass = ApiDefinitionService.class, - mailTemplate = "api/DefinitionUpdate", subject = "接口定义通知") + subject = "接口定义通知") public void editByParams(@RequestBody ApiBatchRequest request) { apiDefinitionService.editApiByParam(request); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java b/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java index 9cd91f07a8..6ceb7e2c25 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java @@ -100,21 +100,21 @@ public class ApiTestCaseController { @PostMapping(value = "/create", consumes = {"multipart/form-data"}) @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request)", msClass = ApiTestCaseService.class) - @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_CREATE, mailTemplate = "api/CaseCreate", subject = "接口用例通知") + @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_CREATE, subject = "接口用例通知") public ApiTestCase create(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { return apiTestCaseService.create(request, bodyFiles); } @PostMapping(value = "/update", consumes = {"multipart/form-data"}) @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request)", title = "#request.name", content = "#msClass.getLogDetails(#request)", msClass = ApiTestCaseService.class) - @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_UPDATE, mailTemplate = "api/CaseUpdate", subject = "接口用例通知") + @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_UPDATE, subject = "接口用例通知") public ApiTestCase update(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { return apiTestCaseService.update(request, bodyFiles); } @PostMapping(value = "/updateExecuteInfo") @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request)", title = "#request.name", content = "#msClass.getLogDetails(#request)", msClass = ApiTestCaseService.class) - @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_UPDATE, mailTemplate = "api/CaseUpdate", subject = "接口用例通知") + @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_UPDATE, subject = "接口用例通知") public ApiTestCase updateExecuteInfo(@RequestBody SaveApiTestCaseRequest request) { return apiTestCaseService.updateExecuteInfo(request); } @@ -128,7 +128,7 @@ public class ApiTestCaseController { @GetMapping("/deleteToGc/{id}") @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = ApiTestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_DELETE, target = "#targetClass.get(#id)", targetClass = ApiTestCaseService.class, - mailTemplate = "api/CaseDelete", subject = "接口用例通知") + subject = "接口用例通知") public void deleteToGc(@PathVariable String id) { apiTestCaseService.deleteToGc(id); } @@ -152,7 +152,7 @@ public class ApiTestCaseController { @PostMapping("/batch/editByParam") @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.getLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = ApiTestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_UPDATE, target = "#targetClass.getApiCaseByIds(#request.ids)", targetClass = ApiTestCaseService.class, - mailTemplate = "api/CaseUpdate", subject = "接口用例通知") + subject = "接口用例通知") public void editApiBathByParam(@RequestBody ApiTestBatchRequest request) { apiTestCaseService.editApiBathByParam(request); } @@ -184,7 +184,7 @@ public class ApiTestCaseController { @PostMapping("/deleteToGcByParam") @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiTestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_DELETE, target = "#targetClass.getApiCaseByIds(#request.ids)", targetClass = ApiTestCaseService.class, - mailTemplate = "api/CaseDelete", subject = "接口用例通知") + subject = "接口用例通知") public void deleteToGcByParam(@RequestBody ApiTestBatchRequest request) { apiTestCaseService.deleteToGcByParam(request); } diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java index caca473ae9..a8c7fe2ead 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java @@ -186,8 +186,6 @@ public class ApiDefinitionExecResultService { .operator(result.getUserId() != null ? result.getUserId() : SessionUtils.getUserId()) .context(context) .subject("接口用例通知") - .successMailTemplate("api/CaseResultSuccess") - .failedMailTemplate("api/CaseResultFailed") .paramMap(paramMap) .event(event) .build(); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index e870ab3c95..b99d0baa85 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -1211,7 +1211,6 @@ public class ApiDefinitionService { .context(context) .testId(scheduleId) .subject(Translator.get("swagger_url_scheduled_import_notification")) - .failedMailTemplate("SwaggerImportFaild") .paramMap(paramMap) .event(NoticeConstants.Event.IMPORT) .build(); @@ -1237,7 +1236,6 @@ public class ApiDefinitionService { .context(context) .testId(scheduleId) .subject(Translator.get("swagger_url_scheduled_import_notification")) - .successMailTemplate("SwaggerImport") .paramMap(paramMap) .event(NoticeConstants.Event.EXECUTE_SUCCESSFUL) .build(); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java index 354f98c2a2..074b8a03a6 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -509,8 +509,6 @@ public class ApiScenarioReportService { .operator(userId) .context(context) .subject("接口自动化通知") - .successMailTemplate("api/ScenarioResultSuccess") - .failedMailTemplate("api/ScenarioResultFailed") .paramMap(paramMap) .event(event) .build(); diff --git a/backend/src/main/java/io/metersphere/api/service/TestResultService.java b/backend/src/main/java/io/metersphere/api/service/TestResultService.java index bf4dcbf0eb..54b4c9defd 100644 --- a/backend/src/main/java/io/metersphere/api/service/TestResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/TestResultService.java @@ -251,9 +251,7 @@ public class TestResultService { NoticeModel noticeModel = NoticeModel.builder() .operator(report.getUserId()) .successContext(successContext) - .successMailTemplate("ApiSuccessfulNotification") .failedContext(failedContext) - .failedMailTemplate("ApiFailedNotification") .testId(testId) .status(report.getStatus()) .event(event) diff --git a/backend/src/main/java/io/metersphere/notice/annotation/SendNotice.java b/backend/src/main/java/io/metersphere/notice/annotation/SendNotice.java index a89dec0a05..a448c8992c 100644 --- a/backend/src/main/java/io/metersphere/notice/annotation/SendNotice.java +++ b/backend/src/main/java/io/metersphere/notice/annotation/SendNotice.java @@ -37,14 +37,4 @@ public @interface SendNotice { String successContext() default ""; String failedContext() default ""; - - /** - * html 消息模版 - */ - String mailTemplate() default ""; - - String failedMailTemplate() default ""; - - String successMailTemplate() default ""; - } diff --git a/backend/src/main/java/io/metersphere/notice/sender/AbstractNoticeSender.java b/backend/src/main/java/io/metersphere/notice/sender/AbstractNoticeSender.java index 843664ff28..f5cb43d74e 100644 --- a/backend/src/main/java/io/metersphere/notice/sender/AbstractNoticeSender.java +++ b/backend/src/main/java/io/metersphere/notice/sender/AbstractNoticeSender.java @@ -87,45 +87,6 @@ public abstract class AbstractNoticeSender implements NoticeSender { } return getContent(context, noticeModel.getParamMap()); } - - protected String getHtmlContext(MessageDetail messageDetail, NoticeModel noticeModel) { - // 处理 userIds 中包含的特殊值 - noticeModel.setReceivers(getRealUserIds(messageDetail, noticeModel, messageDetail.getEvent())); - - // 如果配置了模版就直接使用模版 - if (StringUtils.isNotBlank(messageDetail.getTemplate())) { - return getContent(messageDetail.getTemplate(), noticeModel.getParamMap()); - } - - // 处理 mail context - String context = ""; - try { - switch (messageDetail.getEvent()) { - case NoticeConstants.Event.EXECUTE_FAILED: - URL resource1 = this.getClass().getResource("/mail/" + noticeModel.getFailedMailTemplate() + ".html"); - context = IOUtils.toString(resource1, StandardCharsets.UTF_8); - break; - case NoticeConstants.Event.EXECUTE_SUCCESSFUL: - URL resource2 = this.getClass().getResource("/mail/" + noticeModel.getSuccessMailTemplate() + ".html"); - context = IOUtils.toString(resource2, StandardCharsets.UTF_8); - break; - default: - URL resource3 = this.getClass().getResource("/mail/" + noticeModel.getMailTemplate() + ".html"); - context = IOUtils.toString(resource3, StandardCharsets.UTF_8); - break; - } - } catch (IOException e) { - LogUtil.error(e); - // 兼容 - try { - URL resource3 = this.getClass().getResource("/mail/" + noticeModel.getMailTemplate() + ".html"); - context = IOUtils.toString(resource3, StandardCharsets.UTF_8); - } catch (IOException ex) { - } - } - return getContent(context, noticeModel.getParamMap()); - } - protected String getContent(String template, Map context) { // 处理 null context.forEach((k, v) -> { diff --git a/backend/src/main/java/io/metersphere/notice/sender/AfterReturningNoticeSendService.java b/backend/src/main/java/io/metersphere/notice/sender/AfterReturningNoticeSendService.java index 4dbf1b262f..1036ebbfd9 100644 --- a/backend/src/main/java/io/metersphere/notice/sender/AfterReturningNoticeSendService.java +++ b/backend/src/main/java/io/metersphere/notice/sender/AfterReturningNoticeSendService.java @@ -42,7 +42,6 @@ public class AfterReturningNoticeSendService { .operator(sessionUser.getId()) .context(context) .subject(sendNotice.subject()) - .mailTemplate(sendNotice.mailTemplate()) .paramMap(paramMap) .event(sendNotice.event()) .status((String) paramMap.get("status")) diff --git a/backend/src/main/java/io/metersphere/notice/sender/NoticeModel.java b/backend/src/main/java/io/metersphere/notice/sender/NoticeModel.java index b9bc183e46..6a5a032120 100644 --- a/backend/src/main/java/io/metersphere/notice/sender/NoticeModel.java +++ b/backend/src/main/java/io/metersphere/notice/sender/NoticeModel.java @@ -38,13 +38,6 @@ public class NoticeModel implements Serializable { private String successContext; private String failedContext; - /** - * html 消息模版 - */ - private String mailTemplate; - private String failedMailTemplate; - private String successMailTemplate; - /** * 保存特殊的用户 */ diff --git a/backend/src/main/java/io/metersphere/notice/sender/impl/MailNoticeSender.java b/backend/src/main/java/io/metersphere/notice/sender/impl/MailNoticeSender.java index 9049820c2e..ae62646023 100644 --- a/backend/src/main/java/io/metersphere/notice/sender/impl/MailNoticeSender.java +++ b/backend/src/main/java/io/metersphere/notice/sender/impl/MailNoticeSender.java @@ -139,7 +139,7 @@ public class MailNoticeSender extends AbstractNoticeSender { @Override public void send(MessageDetail messageDetail, NoticeModel noticeModel) { - String context = super.getHtmlContext(messageDetail, noticeModel); + String context = super.getContext(messageDetail, noticeModel); try { sendMail(context, noticeModel); LogUtil.debug("发送邮件结束"); diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java index 627f490f64..4c3b1d4292 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceReportController.java @@ -53,7 +53,7 @@ public class PerformanceReportController { @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_DELETE) @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST_REPORT, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#reportId)", msClass = PerformanceReportService.class) @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_REPORT_TASK, event = NoticeConstants.Event.DELETE, - target = "#targetClass.getReport(#reportId)", targetClass = PerformanceReportService.class, mailTemplate = "performance/ReportDelete", subject = "性能测试报告通知") + target = "#targetClass.getReport(#reportId)", targetClass = PerformanceReportService.class, subject = "性能测试报告通知") public void deleteReport(@PathVariable String reportId) { performanceReportService.deleteReport(reportId); } @@ -139,7 +139,7 @@ public class PerformanceReportController { @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_DELETE) @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST_REPORT, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#reportRequest.ids)", msClass = PerformanceReportService.class) @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_REPORT_TASK, event = NoticeConstants.Event.DELETE, - target = "#targetClass.getReportList(#reportRequest.ids)", targetClass = PerformanceReportService.class, mailTemplate = "performance/ReportDelete", subject = "性能测试报告通知") + target = "#targetClass.getReportList(#reportRequest.ids)", targetClass = PerformanceReportService.class, subject = "性能测试报告通知") public void deleteReportBatch(@RequestBody DeleteReportRequest reportRequest) { performanceReportService.deleteReportBatch(reportRequest); } diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java index 8e930da6c7..098c2977a4 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java @@ -88,7 +88,7 @@ public class PerformanceTestController { @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_CREATE) @CacheNode // 把监控节点缓存起来 @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.CREATE, - mailTemplate = "performance/TestCreate", subject = "性能测试通知") + subject = "性能测试通知") public LoadTest save( @RequestPart("request") SaveTestPlanRequest request, @RequestPart(value = "file", required = false) List files @@ -108,7 +108,7 @@ public class PerformanceTestController { @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_EDIT) @CacheNode // 把监控节点缓存起来 - @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "performance/TestUpdate", subject = "性能测试通知") + @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.UPDATE, subject = "性能测试通知") public LoadTest edit( @RequestPart("request") EditTestPlanRequest request, @RequestPart(value = "file", required = false) List files @@ -166,7 +166,7 @@ public class PerformanceTestController { @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_DELETE) @CacheNode // 把监控节点缓存起来 @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.DELETE, - target = "#targetClass.get(#request.id)", targetClass = PerformanceTestService.class, mailTemplate = "performance/TestDelete", subject = "性能测试通知") + target = "#targetClass.get(#request.id)", targetClass = PerformanceTestService.class, subject = "性能测试通知") public void delete(@RequestBody DeleteTestPlanRequest request) { checkPermissionService.checkPerformanceTestOwner(request.getId()); performanceTestService.delete(request); diff --git a/backend/src/main/java/io/metersphere/performance/notice/PerformanceNoticeEvent.java b/backend/src/main/java/io/metersphere/performance/notice/PerformanceNoticeEvent.java index 398f8e18ff..7bcad36244 100644 --- a/backend/src/main/java/io/metersphere/performance/notice/PerformanceNoticeEvent.java +++ b/backend/src/main/java/io/metersphere/performance/notice/PerformanceNoticeEvent.java @@ -76,9 +76,7 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent { NoticeModel noticeModel = NoticeModel.builder() .operator(loadTestReport.getUserId()) .successContext(successContext) - .successMailTemplate("PerformanceSuccessNotification") .failedContext(failedContext) - .failedMailTemplate("PerformanceFailedNotification") .testId(loadTestReport.getTestId()) .status(loadTestReport.getStatus()) .subject(subject) @@ -92,7 +90,6 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent { NoticeModel noticeModel2 = NoticeModel.builder() .operator(loadTestReport.getUserId()) .context(context) - .mailTemplate("performance/TestResult") .testId(loadTestReport.getTestId()) .status(loadTestReport.getStatus()) .subject(subject) diff --git a/backend/src/main/java/io/metersphere/track/controller/IssueCommentController.java b/backend/src/main/java/io/metersphere/track/controller/IssueCommentController.java index f873671712..f09c54dccb 100644 --- a/backend/src/main/java/io/metersphere/track/controller/IssueCommentController.java +++ b/backend/src/main/java/io/metersphere/track/controller/IssueCommentController.java @@ -30,7 +30,7 @@ public class IssueCommentController { @PostMapping("/save") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#targetClass.get(#request.issuesId)", targetClass = IssuesService.class, - event = NoticeConstants.Event.COMMENT, mailTemplate = "track/IssuesCommentUpdate", subject = "缺陷") + event = NoticeConstants.Event.COMMENT, subject = "缺陷") public IssueComment saveComment(@RequestBody IssuesRelevanceRequest request) { request.setId(UUID.randomUUID().toString()); return issueCommentService.saveComment(request); diff --git a/backend/src/main/java/io/metersphere/track/controller/IssuesController.java b/backend/src/main/java/io/metersphere/track/controller/IssuesController.java index dd35255507..2636faed83 100644 --- a/backend/src/main/java/io/metersphere/track/controller/IssuesController.java +++ b/backend/src/main/java/io/metersphere/track/controller/IssuesController.java @@ -61,7 +61,7 @@ public class IssuesController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ_CREATE) @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#issuesRequest)", msClass = IssuesService.class) @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#issuesRequest", - event = NoticeConstants.Event.CREATE, mailTemplate = "track/IssuesCreate", subject = "缺陷通知") + event = NoticeConstants.Event.CREATE, subject = "缺陷通知") public IssuesWithBLOBs addIssues(@RequestBody IssuesUpdateRequest issuesRequest) { return issuesService.addIssues(issuesRequest); } @@ -70,7 +70,7 @@ public class IssuesController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ_EDIT) @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#issuesRequest.id)", content = "#msClass.getLogDetails(#issuesRequest.id)", msClass = IssuesService.class) @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#issuesRequest", - event = NoticeConstants.Event.UPDATE, mailTemplate = "track/IssuesUpdate", subject = "缺陷通知") + event = NoticeConstants.Event.UPDATE, subject = "缺陷通知") public void updateIssues(@RequestBody IssuesUpdateRequest issuesRequest) { issuesService.updateIssues(issuesRequest); } @@ -115,7 +115,7 @@ public class IssuesController { @GetMapping("/delete/{id}") @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssuesService.class) - @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#targetClass.get(#id)", targetClass = IssuesService.class, event = NoticeConstants.Event.DELETE, mailTemplate = "track/IssuesDelete", subject = "缺陷通知") + @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#targetClass.get(#id)", targetClass = IssuesService.class, event = NoticeConstants.Event.DELETE, subject = "缺陷通知") public void delete(@PathVariable String id) { issuesService.delete(id); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseCommentController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseCommentController.java index dbb9f63616..2de2d157d6 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseCommentController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseCommentController.java @@ -29,7 +29,7 @@ public class TestCaseCommentController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseCommentService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.getTestCase(#request.caseId)", targetClass = TestCaseService.class, - event = NoticeConstants.Event.COMMENT, mailTemplate = "track/TestCaseComment", subject = "测试用例通知") + event = NoticeConstants.Event.COMMENT, subject = "测试用例通知") public TestCaseComment saveComment(@RequestBody SaveCommentRequest request) { request.setId(UUID.randomUUID().toString()); return testCaseCommentService.saveComment(request); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java index 17eb9a2e95..828c4ab069 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java @@ -196,7 +196,7 @@ public class TestCaseController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_CREATE) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, targetClass = TestCaseMapper.class, - event = NoticeConstants.Event.CREATE, mailTemplate = "track/TestCaseCreate", subject = "测试用例通知") + event = NoticeConstants.Event.CREATE, subject = "测试用例通知") public TestCase addTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { if (StringUtils.isBlank(request.getId())) { //新增 后端生成 id @@ -216,7 +216,7 @@ public class TestCaseController { @PostMapping(value = "/edit", consumes = {"multipart/form-data"}) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.getTestCase(#request.id)", targetClass = TestCaseService.class, - event = NoticeConstants.Event.UPDATE, mailTemplate = "track/TestCaseUpdate", subject = "测试用例通知") + event = NoticeConstants.Event.UPDATE, subject = "测试用例通知") public TestCase editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { return testCaseService.edit(request, files); } @@ -237,7 +237,7 @@ public class TestCaseController { @PostMapping("/deleteToGc/{testCaseId}") @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#testCaseId)", msClass = TestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, event = NoticeConstants.Event.DELETE, target = "#targetClass.getTestCase(#testCaseId)", targetClass = TestCaseService.class, - mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") + subject = "测试用例通知") public int deleteToGC(@PathVariable String testCaseId) { checkPermissionService.checkTestCaseOwner(testCaseId); return testCaseService.deleteTestCaseToGc(testCaseId); @@ -246,7 +246,7 @@ public class TestCaseController { @GetMapping("/deletePublic/{versionId}/{refId}") @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#testCaseId)", msClass = TestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, event = NoticeConstants.Event.DELETE, target = "#targetClass.getTestCase(#testCaseId)", targetClass = TestCaseService.class, - mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") + subject = "测试用例通知") public void deletePublic(@PathVariable String versionId, @PathVariable String refId) { testCaseService.deleteTestCasePublic(versionId, refId); } @@ -289,7 +289,7 @@ public class TestCaseController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.getLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.findByBatchRequest(#request)", targetClass = TestCaseService.class, - event = NoticeConstants.Event.UPDATE, mailTemplate = "track/TestCaseUpdate", subject = "测试用例通知") + event = NoticeConstants.Event.UPDATE, subject = "测试用例通知") public void editTestCaseBath(@RequestBody TestCaseBatchRequest request) { testCaseService.editTestCaseBath(request); } @@ -305,7 +305,7 @@ public class TestCaseController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.BATCH_ADD, beforeEvent = "#msClass.getLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.findByBatchRequest(#request)", targetClass = TestCaseService.class, - event = NoticeConstants.Event.CREATE, mailTemplate = "track/TestCaseUpdate", subject = "测试用例通知") + event = NoticeConstants.Event.CREATE, subject = "测试用例通知") public void copyTestCaseBathPublic(@RequestBody TestCaseBatchRequest request) { testCaseService.copyTestCaseBathPublic(request); } @@ -322,7 +322,7 @@ public class TestCaseController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_DELETE) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.findByBatchRequest(#request)", targetClass = TestCaseService.class, - event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") + event = NoticeConstants.Event.DELETE, subject = "测试用例通知") public void deleteToGcBatch(@RequestBody TestCaseBatchRequest request) { testCaseService.deleteToGcBatch(request.getIds()); } @@ -331,7 +331,7 @@ public class TestCaseController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_DELETE) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.findByBatchRequest(#request)", targetClass = TestCaseService.class, - event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") + event = NoticeConstants.Event.DELETE, subject = "测试用例通知") public void deleteToGcBatchPublic(@RequestBody TestCaseBatchRequest request) { testCaseService.deleteToGcBatchPublic(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseReviewController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseReviewController.java index e7a0970e09..df1e4a1bd1 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseReviewController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseReviewController.java @@ -53,7 +53,7 @@ public class TestCaseReviewController { @PostMapping("/save") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_CREATE) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.CREATE, title = "#reviewRequest.name", content = "#msClass.getLogDetails(#reviewRequest.id)", msClass = TestCaseReviewService.class) - @SendNotice(taskType = NoticeConstants.TaskType.REVIEW_TASK, event = NoticeConstants.Event.CREATE, mailTemplate = "track/ReviewInitiate", subject = "测试评审通知") + @SendNotice(taskType = NoticeConstants.TaskType.REVIEW_TASK, event = NoticeConstants.Event.CREATE, subject = "测试评审通知") public TestCaseReview saveCaseReview(@RequestBody SaveTestCaseReviewRequest reviewRequest) { reviewRequest.setId(UUID.randomUUID().toString()); return testCaseReviewService.saveTestCaseReview(reviewRequest); @@ -85,7 +85,7 @@ public class TestCaseReviewController { @PostMapping("/edit") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_EDIT) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#testCaseReview.id)", title = "#testCaseReview.name", content = "#msClass.getLogDetails(#testCaseReview.id)", msClass = TestCaseReviewService.class) - @SendNotice(taskType = NoticeConstants.TaskType.REVIEW_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "track/ReviewUpdate", subject = "测试评审通知") + @SendNotice(taskType = NoticeConstants.TaskType.REVIEW_TASK, event = NoticeConstants.Event.UPDATE, subject = "测试评审通知") public TestCaseReview editCaseReview(@RequestBody SaveTestCaseReviewRequest testCaseReview) { return testCaseReviewService.editCaseReview(testCaseReview); } @@ -94,7 +94,7 @@ public class TestCaseReviewController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_DELETE) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#reviewId)", msClass = TestCaseReviewService.class) @SendNotice(taskType = NoticeConstants.TaskType.REVIEW_TASK, target = "#targetClass.getTestReview(#reviewId)", targetClass = TestCaseReviewService.class, - event = NoticeConstants.Event.DELETE, mailTemplate = "track/ReviewDelete", subject = "测试评审通知") + event = NoticeConstants.Event.DELETE, subject = "测试评审通知") public void deleteCaseReview(@PathVariable String reviewId) { checkPermissionService.checkTestReviewOwner(reviewId); testCaseReviewService.deleteCaseReview(reviewId); @@ -157,7 +157,7 @@ public class TestCaseReviewController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseCommentService.class) @SendNotice(taskType = NoticeConstants.TaskType.REVIEW_TASK, target = "#targetClass.getTestReview(#request.reviewId)", targetClass = TestCaseReviewService.class, - event = NoticeConstants.Event.COMMENT, mailTemplate = "track/TestCaseComment", subject = "测试评审通知") + event = NoticeConstants.Event.COMMENT, subject = "测试评审通知") public TestCaseComment saveComment(@RequestBody SaveCommentRequest request) { request.setId(UUID.randomUUID().toString()); return testCaseCommentService.saveComment(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 1743bd2405..f6fb14feeb 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java @@ -102,7 +102,7 @@ public class TestPlanController { @PostMapping("/add") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_CREATE) @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.CREATE, title = "#testPlan.name", content = "#msClass.getLogDetails(#testPlan.id)", msClass = TestPlanService.class) - @SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, event = NoticeConstants.Event.CREATE, mailTemplate = "track/TestPlanStart", subject = "测试计划通知") + @SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, event = NoticeConstants.Event.CREATE, subject = "测试计划通知") public TestPlan addTestPlan(@RequestBody AddTestPlanRequest testPlan) { testPlan.setId(UUID.randomUUID().toString()); return testPlanService.addTestPlan(testPlan); @@ -111,7 +111,7 @@ public class TestPlanController { @PostMapping("/edit") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_EDIT) @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#testPlanDTO.id)", content = "#msClass.getLogDetails(#testPlanDTO.id)", msClass = TestPlanService.class) - @SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "track/TestPlanUpdate", subject = "测试计划通知") + @SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, event = NoticeConstants.Event.UPDATE, subject = "测试计划通知") public TestPlan editTestPlan(@RequestBody AddTestPlanRequest testPlanDTO) { return testPlanService.editTestPlanWithRequest(testPlanDTO); } @@ -141,7 +141,7 @@ public class TestPlanController { @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_DELETE) @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testPlanId)", msClass = TestPlanService.class) @SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, target = "#targetClass.get(#testPlanId)", targetClass = TestPlanService.class, - event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestPlanDelete", subject = "测试计划通知") + event = NoticeConstants.Event.DELETE, subject = "测试计划通知") public int deleteTestPlan(@PathVariable String testPlanId) { checkPermissionService.checkTestPlanOwner(testPlanId); return testPlanService.deleteTestPlan(testPlanId); @@ -184,7 +184,7 @@ public class TestPlanController { } @PostMapping("/copy/{id}") - @SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, event = NoticeConstants.Event.CREATE, mailTemplate = "track/TestPlanStart", subject = "测试计划通知") + @SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, event = NoticeConstants.Event.CREATE, subject = "测试计划通知") public TestPlan copy(@PathVariable String id) { return testPlanService.copy(id); } @@ -261,7 +261,7 @@ public class TestPlanController { } @PostMapping(value = "/schedule/updateEnableByPrimyKey/disable") - @SendNotice(taskType = NoticeConstants.TaskType.TRACK_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, mailTemplate = "track/ScheduleClose", subject = "测试跟踪通知") + @SendNotice(taskType = NoticeConstants.TaskType.TRACK_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, subject = "测试跟踪通知") public Schedule disableSchedule(@RequestBody ScheduleInfoRequest request) { Schedule schedule = scheduleService.getSchedule(request.getTaskID()); schedule.setEnable(false); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java index 383abc6ea3..19d155777f 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java @@ -61,7 +61,7 @@ public class TestPlanReportController { @PostMapping("/delete") @MsAuditLog(module = OperLogModule.TRACK_REPORT, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testPlanReportIdList)", msClass = TestPlanReportService.class) @SendNotice(taskType = NoticeConstants.TaskType.TRACK_REPORT_TASK, target = "#targetClass.getReports(#testPlanReportIdList)", targetClass = TestPlanReportService.class, - event = NoticeConstants.Event.DELETE, mailTemplate = "track/ReportDelete", subject = "报告通知") + event = NoticeConstants.Event.DELETE, subject = "报告通知") public void delete(@RequestBody List testPlanReportIdList) { testPlanReportService.delete(testPlanReportIdList); } diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java index e08c9ceceb..2261523dab 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java @@ -419,7 +419,6 @@ public class TestCaseReviewService { .operator(SessionUtils.getUserId()) .context(context) .subject("测试评审通知") - .mailTemplate("track/ReviewEnd") .paramMap(paramMap) .event(NoticeConstants.Event.COMPLETE) .status(TestCaseReviewStatus.Completed.name()) diff --git a/backend/src/main/resources/mail/ApiFailedNotification.html b/backend/src/main/resources/mail/ApiFailedNotification.html deleted file mode 100644 index 8abcf40d0b..0000000000 --- a/backend/src/main/resources/mail/ApiFailedNotification.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - MeterSphere - - -
-
-

尊敬的用户:

-

您好: -

-
-

${operator}执行接口测试失败: ${name}

- 报告: - ${reportUrl} -
- -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/ApiSuccessfulNotification.html b/backend/src/main/resources/mail/ApiSuccessfulNotification.html deleted file mode 100644 index e59abfb966..0000000000 --- a/backend/src/main/resources/mail/ApiSuccessfulNotification.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - MeterSphere - - -
-

尊敬的用户:

-

您好: -

-
-

${operator}执行接口测试成功: ${name}

- 报告: - ${reportUrl} -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/PerformanceFailedNotification.html b/backend/src/main/resources/mail/PerformanceFailedNotification.html deleted file mode 100644 index 41da8c827f..0000000000 --- a/backend/src/main/resources/mail/PerformanceFailedNotification.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - MeterSphere - - -
-
-

尊敬的用户:

-

您好: -

-
-

您所执行的 ${name} 启动失败
-

- -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/PerformanceSuccessNotification.html b/backend/src/main/resources/mail/PerformanceSuccessNotification.html deleted file mode 100644 index 0293d6e241..0000000000 --- a/backend/src/main/resources/mail/PerformanceSuccessNotification.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
- ${operator}执行性能测试成功: ${name}, 报告: ${reportUrl} -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/ReviewComments.html b/backend/src/main/resources/mail/ReviewComments.html deleted file mode 100644 index feeef01250..0000000000 --- a/backend/src/main/resources/mail/ReviewComments.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - MeterSphere - - -
-

${maintainer}为
- ${testCaseName}
- 添加评论:${description}
- 点击下面链接进入用例评审页面

- ${url}/#/track/review/view/${id} -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/SwaggerImport.html b/backend/src/main/resources/mail/SwaggerImport.html deleted file mode 100644 index f16b6b3659..0000000000 --- a/backend/src/main/resources/mail/SwaggerImport.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - MeterSphere - - -
-

- ${url}
- 导入成功! -

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/SwaggerImportFaild.html b/backend/src/main/resources/mail/SwaggerImportFaild.html deleted file mode 100644 index 8ba37f481b..0000000000 --- a/backend/src/main/resources/mail/SwaggerImportFaild.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - MeterSphere - - -
-

- ${url}
- 导入失败! -

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/TestPlanFailedNotification.html b/backend/src/main/resources/mail/TestPlanFailedNotification.html deleted file mode 100644 index 3d6614e9f6..0000000000 --- a/backend/src/main/resources/mail/TestPlanFailedNotification.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - MeterSphere - - -
-
-

尊敬的用户:

-

您好: -

-
-

${operator}执行的 ${name} 测试计划运行失败
- 请点击下面链接进入测试报告页面

- ${planShareUrl} -
- -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/TestPlanSuccessfulNotification.html b/backend/src/main/resources/mail/TestPlanSuccessfulNotification.html deleted file mode 100644 index cbecc933be..0000000000 --- a/backend/src/main/resources/mail/TestPlanSuccessfulNotification.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - MeterSphere - - -
-

尊敬的用户:

-

您好: -

-
-

${operator}执行的 ${name} 测试计划运行成功
- 请点击下面链接进入测试报告页面

- ${planShareUrl} -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/AutomationCreate.html b/backend/src/main/resources/mail/api/AutomationCreate.html deleted file mode 100644 index a5cce457af..0000000000 --- a/backend/src/main/resources/mail/api/AutomationCreate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}创建了接口自动化: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/AutomationDelete.html b/backend/src/main/resources/mail/api/AutomationDelete.html deleted file mode 100644 index 890a4dfcff..0000000000 --- a/backend/src/main/resources/mail/api/AutomationDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了接口自动化: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/AutomationUpdate.html b/backend/src/main/resources/mail/api/AutomationUpdate.html deleted file mode 100644 index 206fbb6658..0000000000 --- a/backend/src/main/resources/mail/api/AutomationUpdate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}更新了接口自动化: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/CaseCreate.html b/backend/src/main/resources/mail/api/CaseCreate.html deleted file mode 100644 index 8b7a32059d..0000000000 --- a/backend/src/main/resources/mail/api/CaseCreate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}创建了接口用例: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/CaseDelete.html b/backend/src/main/resources/mail/api/CaseDelete.html deleted file mode 100644 index 7a46cdfe93..0000000000 --- a/backend/src/main/resources/mail/api/CaseDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了接口用例: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/CaseResultFailed.html b/backend/src/main/resources/mail/api/CaseResultFailed.html deleted file mode 100644 index 5fccb612c3..0000000000 --- a/backend/src/main/resources/mail/api/CaseResultFailed.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}执行接口用例失败: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/CaseResultSuccess.html b/backend/src/main/resources/mail/api/CaseResultSuccess.html deleted file mode 100644 index 2721a527da..0000000000 --- a/backend/src/main/resources/mail/api/CaseResultSuccess.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}执行接口用例成功: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/CaseUpdate.html b/backend/src/main/resources/mail/api/CaseUpdate.html deleted file mode 100644 index 53b12328b6..0000000000 --- a/backend/src/main/resources/mail/api/CaseUpdate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}更新了接口用例: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/DefinitionCreate.html b/backend/src/main/resources/mail/api/DefinitionCreate.html deleted file mode 100644 index 51b84b2dcf..0000000000 --- a/backend/src/main/resources/mail/api/DefinitionCreate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}创建了接口定义: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/DefinitionDelete.html b/backend/src/main/resources/mail/api/DefinitionDelete.html deleted file mode 100644 index 6b962d2df4..0000000000 --- a/backend/src/main/resources/mail/api/DefinitionDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了接口定义: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/DefinitionUpdate.html b/backend/src/main/resources/mail/api/DefinitionUpdate.html deleted file mode 100644 index acacad2529..0000000000 --- a/backend/src/main/resources/mail/api/DefinitionUpdate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}更新了接口定义: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/ReportDelete.html b/backend/src/main/resources/mail/api/ReportDelete.html deleted file mode 100644 index 6fcc3e33dd..0000000000 --- a/backend/src/main/resources/mail/api/ReportDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了报告: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/ScenarioResultFailed.html b/backend/src/main/resources/mail/api/ScenarioResultFailed.html deleted file mode 100644 index f71c57f7cd..0000000000 --- a/backend/src/main/resources/mail/api/ScenarioResultFailed.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}执行接口自动化失败: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/ScenarioResultSuccess.html b/backend/src/main/resources/mail/api/ScenarioResultSuccess.html deleted file mode 100644 index 4c2f3fad52..0000000000 --- a/backend/src/main/resources/mail/api/ScenarioResultSuccess.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}执行接口自动化成功: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/api/ScheduleClose.html b/backend/src/main/resources/mail/api/ScheduleClose.html deleted file mode 100644 index aea3718541..0000000000 --- a/backend/src/main/resources/mail/api/ScheduleClose.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}关闭了定时任务: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/performance/ReportDelete.html b/backend/src/main/resources/mail/performance/ReportDelete.html deleted file mode 100644 index ef1959b496..0000000000 --- a/backend/src/main/resources/mail/performance/ReportDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了性能测试报告: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/performance/TestCreate.html b/backend/src/main/resources/mail/performance/TestCreate.html deleted file mode 100644 index a978cbeae0..0000000000 --- a/backend/src/main/resources/mail/performance/TestCreate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}创建了性能测试: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/performance/TestDelete.html b/backend/src/main/resources/mail/performance/TestDelete.html deleted file mode 100644 index ae3f3ff77f..0000000000 --- a/backend/src/main/resources/mail/performance/TestDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了性能测试: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/performance/TestResult.html b/backend/src/main/resources/mail/performance/TestResult.html deleted file mode 100644 index d0c6b897f4..0000000000 --- a/backend/src/main/resources/mail/performance/TestResult.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}执行性能测试: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/performance/TestUpdate.html b/backend/src/main/resources/mail/performance/TestUpdate.html deleted file mode 100644 index 656efe7d08..0000000000 --- a/backend/src/main/resources/mail/performance/TestUpdate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}更新了性能测试: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/IssuesCommentUpdate.html b/backend/src/main/resources/mail/track/IssuesCommentUpdate.html deleted file mode 100644 index 8169964b7b..0000000000 --- a/backend/src/main/resources/mail/track/IssuesCommentUpdate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}更新了缺陷评论: ${title}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/IssuesCreate.html b/backend/src/main/resources/mail/track/IssuesCreate.html deleted file mode 100644 index bfb5b48a71..0000000000 --- a/backend/src/main/resources/mail/track/IssuesCreate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}创建了缺陷: ${title}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/IssuesDelete.html b/backend/src/main/resources/mail/track/IssuesDelete.html deleted file mode 100644 index 3e5f04b055..0000000000 --- a/backend/src/main/resources/mail/track/IssuesDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了缺陷: ${title}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/IssuesUpdate.html b/backend/src/main/resources/mail/track/IssuesUpdate.html deleted file mode 100644 index 9eb39ef688..0000000000 --- a/backend/src/main/resources/mail/track/IssuesUpdate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}更新了缺陷: ${title}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/ReportDelete.html b/backend/src/main/resources/mail/track/ReportDelete.html deleted file mode 100644 index 6fcc3e33dd..0000000000 --- a/backend/src/main/resources/mail/track/ReportDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了报告: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/ReviewDelete.html b/backend/src/main/resources/mail/track/ReviewDelete.html deleted file mode 100644 index 458c3718a8..0000000000 --- a/backend/src/main/resources/mail/track/ReviewDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了用例评审:${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/ReviewEnd.html b/backend/src/main/resources/mail/track/ReviewEnd.html deleted file mode 100644 index f799630af3..0000000000 --- a/backend/src/main/resources/mail/track/ReviewEnd.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}完成了测试评审: ${name}
- 点击下面链接进入用例评审页面

- ${url}/#/track/review/view -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/ReviewInitiate.html b/backend/src/main/resources/mail/track/ReviewInitiate.html deleted file mode 100644 index 9bb28a6ee2..0000000000 --- a/backend/src/main/resources/mail/track/ReviewInitiate.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}发起了测试评审:${name}
- 点击下面链接进入评审页面进行审核

- ${url}/#/track/review/view/${id} -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/ReviewUpdate.html b/backend/src/main/resources/mail/track/ReviewUpdate.html deleted file mode 100644 index 49197b7055..0000000000 --- a/backend/src/main/resources/mail/track/ReviewUpdate.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}更新了测试评审: ${name}
- 点击下面链接进入用例评审页面

- ${url}/#/track/review/view -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/ScheduleClose.html b/backend/src/main/resources/mail/track/ScheduleClose.html deleted file mode 100644 index aea3718541..0000000000 --- a/backend/src/main/resources/mail/track/ScheduleClose.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}关闭了定时任务: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/TestCaseComment.html b/backend/src/main/resources/mail/track/TestCaseComment.html deleted file mode 100644 index a3ae20ea3d..0000000000 --- a/backend/src/main/resources/mail/track/TestCaseComment.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - MeterSphere - - -
-

- ${operator}评论了测试用例: ${name} -

- 点击下面链接进入测试用例 - ${url}/#/track/case/all -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/TestCaseCreate.html b/backend/src/main/resources/mail/track/TestCaseCreate.html deleted file mode 100644 index eaa3a140dc..0000000000 --- a/backend/src/main/resources/mail/track/TestCaseCreate.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - MeterSphere - - -
-

- ${operator}创建了测试用例: ${name} -

- 点击下面链接进入测试用例 - ${url}/#/track/case/all -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/TestCaseDelete.html b/backend/src/main/resources/mail/track/TestCaseDelete.html deleted file mode 100644 index fdfdd5f558..0000000000 --- a/backend/src/main/resources/mail/track/TestCaseDelete.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - MeterSphere - - -
-

- ${operator}删除了测试用例: ${name} -

- 点击下面链接进入测试用例 - ${url}/#/track/case/all -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/TestCaseUpdate.html b/backend/src/main/resources/mail/track/TestCaseUpdate.html deleted file mode 100644 index af01fac86c..0000000000 --- a/backend/src/main/resources/mail/track/TestCaseUpdate.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - MeterSphere - - -
-

- ${operator}修改了测试用例: ${name} -

- 点击下面链接进入测试用例 - ${url}/#/track/case/all -
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/TestPlanComplete.html b/backend/src/main/resources/mail/track/TestPlanComplete.html deleted file mode 100644 index 916bf08701..0000000000 --- a/backend/src/main/resources/mail/track/TestPlanComplete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}完成了测试计划: ${name}
-

- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/TestPlanDelete.html b/backend/src/main/resources/mail/track/TestPlanDelete.html deleted file mode 100644 index ed9ed0821d..0000000000 --- a/backend/src/main/resources/mail/track/TestPlanDelete.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}删除了测试计划: ${name}

-
- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/TestPlanStart.html b/backend/src/main/resources/mail/track/TestPlanStart.html deleted file mode 100644 index b770b19e2c..0000000000 --- a/backend/src/main/resources/mail/track/TestPlanStart.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}创建了测试计划${name}
-

- - \ No newline at end of file diff --git a/backend/src/main/resources/mail/track/TestPlanUpdate.html b/backend/src/main/resources/mail/track/TestPlanUpdate.html deleted file mode 100644 index df72214ca7..0000000000 --- a/backend/src/main/resources/mail/track/TestPlanUpdate.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MeterSphere - - -
-

${operator}更新了测试计划: ${name}
-

- - \ No newline at end of file diff --git a/frontend/src/business/components/api/automation/schedule/ScheduleNotification.vue b/frontend/src/business/components/api/automation/schedule/ScheduleNotification.vue index cd80c259d5..e86218b51f 100644 --- a/frontend/src/business/components/api/automation/schedule/ScheduleNotification.vue +++ b/frontend/src/business/components/api/automation/schedule/ScheduleNotification.vue @@ -144,21 +144,6 @@ export default { data() { return { modes: ['text', 'html'], - title: '\n' + - '\n' + - '\n' + - ' \n' + - ' MeterSphere\n' + - '\n' + - '\n' + - '
\n' + - '
\n' + - ' ${operator}执行接口测试成功: ${name}, 报告: ${reportUrl}' + - '
\n' + - '\n' + - '
\n' + - '\n' + - '', robotTitle: "${operator}执行接口测试成功: ${name}, 报告: ${reportUrl}", scheduleTask: [{ taskType: "scheduleTask", @@ -397,21 +382,18 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'EXECUTE_SUCCESSFUL': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'EXECUTE_FAILED': - htmlTemplate = this.title.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } } } diff --git a/frontend/src/business/components/api/definition/components/import/SwaggerTaskNotification.vue b/frontend/src/business/components/api/definition/components/import/SwaggerTaskNotification.vue index 67de67f23d..a8ab32e002 100644 --- a/frontend/src/business/components/api/definition/components/import/SwaggerTaskNotification.vue +++ b/frontend/src/business/components/api/definition/components/import/SwaggerTaskNotification.vue @@ -144,21 +144,6 @@ export default { data() { return { modes: ['text', 'html'], - title: '\n' + - '\n' + - '\n' + - ' \n' + - ' MeterSphere\n' + - '\n' + - '\n' + - '
\n' + - '
\n' + - ' swagger:${url}导入成功 ' + - '
\n' + - '\n' + - '
\n' + - '\n' + - '', robotTitle: "swagger:${url}导入成功", scheduleTask: [{ @@ -267,21 +252,18 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'EXECUTE_SUCCESSFUL': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'EXECUTE_FAILED': - htmlTemplate = this.title.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } } }, diff --git a/frontend/src/business/components/project/notification/ScheduleTaskNotification.vue b/frontend/src/business/components/project/notification/ScheduleTaskNotification.vue index 37613d5948..2161a8270b 100644 --- a/frontend/src/business/components/project/notification/ScheduleTaskNotification.vue +++ b/frontend/src/business/components/project/notification/ScheduleTaskNotification.vue @@ -144,21 +144,6 @@ export default { data() { return { modes: ['text', 'html'], - title: '\n' + - '\n' + - '\n' + - ' \n' + - ' MeterSphere\n' + - '\n' + - '\n' + - '
\n' + - '
\n' + - ' ${operator}执行测试成功: ${name}, 报告: ${reportUrl}' + - '
\n' + - '\n' + - '
\n' + - '\n' + - '', robotTitle: "${operator}执行测试成功: ${name}, 报告: ${reportUrl}", scheduleTask: [{ taskType: "scheduleTask", @@ -265,21 +250,18 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'EXECUTE_SUCCESSFUL': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'EXECUTE_FAILED': - htmlTemplate = this.title.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } } }, diff --git a/frontend/src/business/components/project/notification/api/ApiAutomationNotification.vue b/frontend/src/business/components/project/notification/api/ApiAutomationNotification.vue index 73ff190422..dd711f442f 100644 --- a/frontend/src/business/components/project/notification/api/ApiAutomationNotification.vue +++ b/frontend/src/business/components/project/notification/api/ApiAutomationNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}创建了接口自动化: ${name}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}创建了接口自动化: ${name}", defectTask: [{ taskType: "defectTask", @@ -391,37 +379,29 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CREATE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'UPDATE': - htmlTemplate = this.title.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新'); break; case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); break; case 'EXECUTE_SUCCESSFUL': - htmlTemplate = this.title.replace('创建', '执行') - .replace('接口自动化', '接口自动化成功'); robotTemplate = this.robotTitle.replace('创建', '执行') .replace('接口自动化', '接口自动化成功'); break; case 'EXECUTE_FAILED': - htmlTemplate = this.title.replace('创建', '执行') - .replace('接口自动化', '接口自动化失败'); robotTemplate = this.robotTitle.replace('创建', '执行') .replace('接口自动化', '接口自动化失败'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/api/ApiDefinitionNotification.vue b/frontend/src/business/components/project/notification/api/ApiDefinitionNotification.vue index 8f74b97c50..477574388f 100644 --- a/frontend/src/business/components/project/notification/api/ApiDefinitionNotification.vue +++ b/frontend/src/business/components/project/notification/api/ApiDefinitionNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}创建了接口定义: ${name}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}创建了接口定义: ${name}", defectTask: [{ taskType: "defectTask", @@ -451,53 +439,40 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CREATE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; this.variables = this.apiVariables; break; case 'UPDATE': - htmlTemplate = this.title.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新'); this.variables = this.apiVariables; break; case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); this.variables = this.apiVariables; break; case 'CASE_CREATE': - htmlTemplate = this.title.replace('接口定义', '接口用例'); robotTemplate = this.robotTitle.replace('接口定义', '接口用例'); this.variables = this.caseVariables; break; case 'CASE_UPDATE': - htmlTemplate = this.title.replace('创建', '更新') - .replace('接口定义', '接口用例'); robotTemplate = this.robotTitle.replace('创建', '更新') .replace('接口定义', '接口用例'); this.variables = this.caseVariables; break; case 'CASE_DELETE': - htmlTemplate = this.title.replace('创建', '删除') - .replace('接口定义', '接口用例'); robotTemplate = this.robotTitle.replace('创建', '删除') .replace('接口定义', '接口用例'); this.variables = this.caseVariables; break; case 'EXECUTE_SUCCESSFUL': - htmlTemplate = this.title.replace('创建', '执行') - .replace('接口定义', '接口用例成功'); robotTemplate = this.robotTitle.replace('创建', '执行') .replace('接口定义', '接口用例成功'); this.variables = this.caseVariables; break; case 'EXECUTE_FAILED': - htmlTemplate = this.title.replace('创建', '执行') - .replace('接口定义', '接口用例失败'); robotTemplate = this.robotTitle.replace('创建', '执行') .replace('接口定义', '接口用例失败'); this.variables = this.caseVariables; @@ -505,7 +480,7 @@ export default { default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/api/ApiHomeNotification.vue b/frontend/src/business/components/project/notification/api/ApiHomeNotification.vue index 4fb3317ba4..1dff07bcc0 100644 --- a/frontend/src/business/components/project/notification/api/ApiHomeNotification.vue +++ b/frontend/src/business/components/project/notification/api/ApiHomeNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}关闭了定时任务

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}关闭了定时任务:${issuesName}", defectTask: [{ taskType: "defectTask", @@ -325,17 +313,15 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CLOSE_SCHEDULE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/api/ApiReportNotification.vue b/frontend/src/business/components/project/notification/api/ApiReportNotification.vue index fd50e97340..bcf5f140ca 100644 --- a/frontend/src/business/components/project/notification/api/ApiReportNotification.vue +++ b/frontend/src/business/components/project/notification/api/ApiReportNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}删除了测试报告: ${name}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}删除了测试报告: ${name}", defectTask: [{ taskType: "defectTask", @@ -324,17 +312,15 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/jenkins/JenkinsNotification.vue b/frontend/src/business/components/project/notification/jenkins/JenkinsNotification.vue index cb5e431a7b..87b2407119 100644 --- a/frontend/src/business/components/project/notification/jenkins/JenkinsNotification.vue +++ b/frontend/src/business/components/project/notification/jenkins/JenkinsNotification.vue @@ -149,18 +149,6 @@ export default { data() { return { modes: ['text', 'html'], - title: '\n' + - '\n' + - '\n' + - ' \n' + - ' MeterSphere\n' + - '\n' + - '\n' + - '
\n' + - '${operator}执行 Jenkins 成功: ${name}' + - '
\n' + - '\n' + - '', robotTitle: "${operator}执行 Jenkins 成功: ${name}", jenkinsTask: [{ taskType: "jenkinsTask", @@ -260,21 +248,18 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'EXECUTE_SUCCESSFUL': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'EXECUTE_FAILED': - htmlTemplate = this.title.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } } } diff --git a/frontend/src/business/components/project/notification/performance/PerformanceReportNotification.vue b/frontend/src/business/components/project/notification/performance/PerformanceReportNotification.vue index 14db9a5024..e21b81dbdd 100644 --- a/frontend/src/business/components/project/notification/performance/PerformanceReportNotification.vue +++ b/frontend/src/business/components/project/notification/performance/PerformanceReportNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}删除了测试报告: ${name}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}删除了测试报告: ${name}", defectTask: [{ taskType: "defectTask", @@ -340,17 +328,15 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'DELETE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/performance/PerformanceTestNotification.vue b/frontend/src/business/components/project/notification/performance/PerformanceTestNotification.vue index b8b3f12bd2..e62c8f8c70 100644 --- a/frontend/src/business/components/project/notification/performance/PerformanceTestNotification.vue +++ b/frontend/src/business/components/project/notification/performance/PerformanceTestNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}创建了性能测试: ${name}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}创建了性能测试: ${name}", defectTask: [{ taskType: "defectTask", @@ -327,31 +315,25 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CREATE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'UPDATE': - htmlTemplate = this.title.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新'); break; case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); break; case 'EXECUTE_COMPLETED': - htmlTemplate = this.title.replace('创建', '执行') - .replace('性能测试', '性能测试完成'); robotTemplate = this.robotTitle.replace('创建', '执行') .replace('性能测试', '性能测试完成'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/track/DefectTaskNotification.vue b/frontend/src/business/components/project/notification/track/DefectTaskNotification.vue index d875a38135..28e34fd008 100644 --- a/frontend/src/business/components/project/notification/track/DefectTaskNotification.vue +++ b/frontend/src/business/components/project/notification/track/DefectTaskNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}创建了缺陷:${title}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}创建了缺陷:${title}", defectTask: [{ taskType: "defectTask", @@ -326,25 +314,21 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CREATE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'UPDATE': - htmlTemplate = this.title.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新'); break; case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/track/TestCaseNotification.vue b/frontend/src/business/components/project/notification/track/TestCaseNotification.vue index 128bc53986..3669aeab2d 100644 --- a/frontend/src/business/components/project/notification/track/TestCaseNotification.vue +++ b/frontend/src/business/components/project/notification/track/TestCaseNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}创建了测试用例:${name}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}创建了测试用例:${name}", defectTask: [{ taskType: "defectTask", @@ -379,29 +367,24 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CREATE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'UPDATE': - htmlTemplate = this.title.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新'); break; case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); break; case 'COMMENT': - htmlTemplate = this.title.replace('创建', '评论'); robotTemplate = this.robotTitle.replace('创建', '评论'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/track/TestPlanTaskNotification.vue b/frontend/src/business/components/project/notification/track/TestPlanTaskNotification.vue index 09f7963d54..879420e492 100644 --- a/frontend/src/business/components/project/notification/track/TestPlanTaskNotification.vue +++ b/frontend/src/business/components/project/notification/track/TestPlanTaskNotification.vue @@ -147,19 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator} 创建了测试计划: ${name}
\n" + - "

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator} 创建了测试计划:${name} ", testCasePlanTask: [{ taskType: "testPlanTask", @@ -404,33 +391,27 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CREATE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'UPDATE': - htmlTemplate = this.title.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新'); break; case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); break; case 'COMMENT': - htmlTemplate = this.title.replace('创建', '评论'); robotTemplate = this.robotTitle.replace('创建', '评论'); break; case "COMPLETE": - htmlTemplate = this.title.replace('创建', '完成测试计划'); robotTemplate = this.robotTitle.replace('创建', '完成测试计划'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } } }, diff --git a/frontend/src/business/components/project/notification/track/TestReviewNotification.vue b/frontend/src/business/components/project/notification/track/TestReviewNotification.vue index 9a94b0c6f0..e10704265b 100644 --- a/frontend/src/business/components/project/notification/track/TestReviewNotification.vue +++ b/frontend/src/business/components/project/notification/track/TestReviewNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - " ${operator}创建了用例评审:${name}
\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}创建了用例评审:${name}", reviewTask: [{ taskType: "reviewTask", @@ -375,33 +363,27 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CREATE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'UPDATE': - htmlTemplate = this.title.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新'); break; case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); break; case 'COMMENT': - htmlTemplate = this.title.replace('创建', '评论'); robotTemplate = this.robotTitle.replace('创建', '评论'); break; case "COMPLETE": - htmlTemplate = this.title.replace('创建', '完成评审'); robotTemplate = this.robotTitle.replace('创建', '完成评审'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } } }, diff --git a/frontend/src/business/components/project/notification/track/TrackHomeNotification.vue b/frontend/src/business/components/project/notification/track/TrackHomeNotification.vue index b82a21e34c..3ffcf9478d 100644 --- a/frontend/src/business/components/project/notification/track/TrackHomeNotification.vue +++ b/frontend/src/business/components/project/notification/track/TrackHomeNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}关闭了定时任务: ${name}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}关闭了定时任务: ${name}", defectTask: [{ taskType: "defectTask", @@ -329,17 +317,15 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'CLOSE_SCHEDULE': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/project/notification/track/TrackReportNotification.vue b/frontend/src/business/components/project/notification/track/TrackReportNotification.vue index 002b54fcff..d92bc0195d 100644 --- a/frontend/src/business/components/project/notification/track/TrackReportNotification.vue +++ b/frontend/src/business/components/project/notification/track/TrackReportNotification.vue @@ -147,18 +147,6 @@ export default { data() { return { modes: ['text', 'html'], - title: "\n" + - "\n" + - "\n" + - " \n" + - " MeterSphere\n" + - "\n" + - "\n" + - "
\n" + - "

${operator}删除了测试报告${name}

\n" + - "
\n" + - "\n" + - "", robotTitle: "${operator}删除了测试报告${name}", defectTask: [{ taskType: "defectTask", @@ -331,17 +319,15 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'DELETE': - htmlTemplate = this.title.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } }, handleReceivers(row) { diff --git a/frontend/src/business/components/track/plan/components/ScheduleNotification.vue b/frontend/src/business/components/track/plan/components/ScheduleNotification.vue index 09f6c44193..03e9a3168b 100644 --- a/frontend/src/business/components/track/plan/components/ScheduleNotification.vue +++ b/frontend/src/business/components/track/plan/components/ScheduleNotification.vue @@ -144,21 +144,6 @@ export default { data() { return { modes: ['text', 'html'], - title: '\n' + - '\n' + - '\n' + - ' \n' + - ' MeterSphere\n' + - '\n' + - '\n' + - '
\n' + - '
\n' + - ' ${operator}执行接口测试成功: ${name}, 报告: ${planShareUrl}' + - '
\n' + - '\n' + - '
\n' + - '\n' + - '', robotTitle: "${operator}执行接口测试成功: ${name}, 报告: ${planShareUrl}", scheduleTask: [{ taskType: "scheduleTask", @@ -360,25 +345,21 @@ export default { }, handleTemplate(index, row) { if (hasLicense()) { - let htmlTemplate = ""; let robotTemplate = ""; switch (row.event) { case 'EXECUTE_SUCCESSFUL': - htmlTemplate = this.title; robotTemplate = this.robotTitle; break; case 'EXECUTE_FAILED': - htmlTemplate = this.title.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败'); break; case 'COMPLETE': - htmlTemplate = this.title.replace('成功', '完成'); robotTemplate = this.robotTitle.replace('成功', '完成'); break; default: break; } - this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); + this.$refs.noticeTemplate.open(row, robotTemplate); } } }