refactor(消息通知): 统一使用文本作为消息通知模版,删除html模版

This commit is contained in:
CaptainB 2022-04-18 17:29:43 +08:00 committed by 刘瑞斌
parent d165d2aef4
commit a63526ab2e
89 changed files with 66 additions and 1059 deletions

View File

@ -55,7 +55,7 @@ public class APIScenarioReportController {
@PostMapping("/delete") @PostMapping("/delete")
@MsAuditLog(module = OperLogModule.API_AUTOMATION_REPORT, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = ApiScenarioReportService.class) @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, @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) { public void delete(@RequestBody DeleteAPIReportRequest request) {
apiReportService.delete(request); apiReportService.delete(request);
} }
@ -63,7 +63,7 @@ public class APIScenarioReportController {
@PostMapping("/batch/delete") @PostMapping("/batch/delete")
@MsAuditLog(module = OperLogModule.API_AUTOMATION_REPORT, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#reportRequest.ids)", msClass = ApiScenarioReportService.class) @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, @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) { public void deleteAPIReportBatch(@RequestBody APIReportBatchRequest request) {
apiReportService.deleteAPIReportBatch(request); apiReportService.deleteAPIReportBatch(request);
} }

View File

@ -384,7 +384,7 @@ public class APITestController {
} }
@PostMapping(value = "/schedule/updateEnableByPrimyKey/disable") @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) { public Schedule disableSchedule(@RequestBody ScheduleInfoRequest request) {
Schedule schedule = scheduleService.getSchedule(request.getTaskID()); Schedule schedule = scheduleService.getSchedule(request.getTaskID());
schedule.setEnable(false); schedule.setEnable(false);

View File

@ -100,7 +100,7 @@ public class ApiAutomationController {
@PostMapping(value = "/create") @PostMapping(value = "/create")
@MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiAutomationService.class) @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) @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<MultipartFile> bodyFiles, public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles", required = false) List<MultipartFile> bodyFiles,
@RequestPart(value = "scenarioFiles", required = false) List<MultipartFile> scenarioFiles) { @RequestPart(value = "scenarioFiles", required = false) List<MultipartFile> scenarioFiles) {
return apiAutomationService.create(request, bodyFiles, scenarioFiles); return apiAutomationService.create(request, bodyFiles, scenarioFiles);
@ -109,7 +109,7 @@ public class ApiAutomationController {
@PostMapping(value = "/update") @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) @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) @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<MultipartFile> bodyFiles, public ApiScenario update(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles", required = false) List<MultipartFile> bodyFiles,
@RequestPart(value = "scenarioFiles", required = false) List<MultipartFile> scenarioFiles) { @RequestPart(value = "scenarioFiles", required = false) List<MultipartFile> scenarioFiles) {
return apiAutomationService.update(request, bodyFiles, scenarioFiles); return apiAutomationService.update(request, bodyFiles, scenarioFiles);
@ -131,7 +131,7 @@ public class ApiAutomationController {
@PostMapping("/deleteBatch") @PostMapping("/deleteBatch")
@MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiAutomationService.class) @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, @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<String> ids) { public void deleteBatch(@RequestBody List<String> ids) {
apiAutomationService.deleteBatch(ids); apiAutomationService.deleteBatch(ids);
} }
@ -145,7 +145,7 @@ public class ApiAutomationController {
@PostMapping("/removeToGc") @PostMapping("/removeToGc")
@MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiAutomationService.class) @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, @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<String> ids) { public void removeToGc(@RequestBody List<String> ids) {
apiAutomationService.removeToGc(ids); apiAutomationService.removeToGc(ids);
} }
@ -153,7 +153,7 @@ public class ApiAutomationController {
@PostMapping("/removeToGcByBatch") @PostMapping("/removeToGcByBatch")
@MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.BATCH_GC, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) @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, @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) { public void removeToGcByBatch(@RequestBody ApiScenarioBatchRequest request) {
apiAutomationService.removeToGcByBatch(request); apiAutomationService.removeToGcByBatch(request);
} }
@ -238,7 +238,7 @@ public class ApiAutomationController {
@RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EDIT) @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) @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, @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) { public void bathEdit(@RequestBody ApiScenarioBatchRequest request) {
apiAutomationService.bathEdit(request); apiAutomationService.bathEdit(request);
} }

View File

@ -102,7 +102,7 @@ public class ApiDefinitionController {
@PostMapping(value = "/create", consumes = {"multipart/form-data"}) @PostMapping(value = "/create", consumes = {"multipart/form-data"})
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API) @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) @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<MultipartFile> bodyFiles) { public ApiDefinitionWithBLOBs create(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List<MultipartFile> bodyFiles) {
checkPermissionService.checkProjectOwner(request.getProjectId()); checkPermissionService.checkProjectOwner(request.getProjectId());
return apiDefinitionService.create(request, bodyFiles); return apiDefinitionService.create(request, bodyFiles);
@ -111,7 +111,7 @@ public class ApiDefinitionController {
@PostMapping(value = "/update", consumes = {"multipart/form-data"}) @PostMapping(value = "/update", consumes = {"multipart/form-data"})
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_EDIT_API) @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) @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<MultipartFile> bodyFiles) { public ApiDefinitionWithBLOBs update(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List<MultipartFile> bodyFiles) {
checkPermissionService.checkProjectOwner(request.getProjectId()); checkPermissionService.checkProjectOwner(request.getProjectId());
return apiDefinitionService.update(request, bodyFiles); return apiDefinitionService.update(request, bodyFiles);
@ -150,7 +150,7 @@ public class ApiDefinitionController {
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API)
@MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiDefinitionService.class) @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, @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<String> ids) { public void removeToGc(@RequestBody List<String> ids) {
apiDefinitionService.removeToGc(ids); apiDefinitionService.removeToGc(ids);
} }
@ -159,7 +159,7 @@ public class ApiDefinitionController {
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API) @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) @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, @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) { public void removeToGcByParams(@RequestBody ApiBatchRequest request) {
apiDefinitionService.removeToGcByParams(request); apiDefinitionService.removeToGcByParams(request);
} }
@ -274,7 +274,7 @@ public class ApiDefinitionController {
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_EDIT_API) @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) @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, @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) { public void editByParams(@RequestBody ApiBatchRequest request) {
apiDefinitionService.editApiByParam(request); apiDefinitionService.editApiByParam(request);
} }

View File

@ -100,21 +100,21 @@ public class ApiTestCaseController {
@PostMapping(value = "/create", consumes = {"multipart/form-data"}) @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) @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<MultipartFile> bodyFiles) { public ApiTestCase create(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List<MultipartFile> bodyFiles) {
return apiTestCaseService.create(request, bodyFiles); return apiTestCaseService.create(request, bodyFiles);
} }
@PostMapping(value = "/update", consumes = {"multipart/form-data"}) @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) @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<MultipartFile> bodyFiles) { public ApiTestCase update(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List<MultipartFile> bodyFiles) {
return apiTestCaseService.update(request, bodyFiles); return apiTestCaseService.update(request, bodyFiles);
} }
@PostMapping(value = "/updateExecuteInfo") @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) @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) { public ApiTestCase updateExecuteInfo(@RequestBody SaveApiTestCaseRequest request) {
return apiTestCaseService.updateExecuteInfo(request); return apiTestCaseService.updateExecuteInfo(request);
} }
@ -128,7 +128,7 @@ public class ApiTestCaseController {
@GetMapping("/deleteToGc/{id}") @GetMapping("/deleteToGc/{id}")
@MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = ApiTestCaseService.class) @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, @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) { public void deleteToGc(@PathVariable String id) {
apiTestCaseService.deleteToGc(id); apiTestCaseService.deleteToGc(id);
} }
@ -152,7 +152,7 @@ public class ApiTestCaseController {
@PostMapping("/batch/editByParam") @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) @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, @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) { public void editApiBathByParam(@RequestBody ApiTestBatchRequest request) {
apiTestCaseService.editApiBathByParam(request); apiTestCaseService.editApiBathByParam(request);
} }
@ -184,7 +184,7 @@ public class ApiTestCaseController {
@PostMapping("/deleteToGcByParam") @PostMapping("/deleteToGcByParam")
@MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiTestCaseService.class) @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, @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) { public void deleteToGcByParam(@RequestBody ApiTestBatchRequest request) {
apiTestCaseService.deleteToGcByParam(request); apiTestCaseService.deleteToGcByParam(request);
} }

View File

@ -186,8 +186,6 @@ public class ApiDefinitionExecResultService {
.operator(result.getUserId() != null ? result.getUserId() : SessionUtils.getUserId()) .operator(result.getUserId() != null ? result.getUserId() : SessionUtils.getUserId())
.context(context) .context(context)
.subject("接口用例通知") .subject("接口用例通知")
.successMailTemplate("api/CaseResultSuccess")
.failedMailTemplate("api/CaseResultFailed")
.paramMap(paramMap) .paramMap(paramMap)
.event(event) .event(event)
.build(); .build();

View File

@ -1211,7 +1211,6 @@ public class ApiDefinitionService {
.context(context) .context(context)
.testId(scheduleId) .testId(scheduleId)
.subject(Translator.get("swagger_url_scheduled_import_notification")) .subject(Translator.get("swagger_url_scheduled_import_notification"))
.failedMailTemplate("SwaggerImportFaild")
.paramMap(paramMap) .paramMap(paramMap)
.event(NoticeConstants.Event.IMPORT) .event(NoticeConstants.Event.IMPORT)
.build(); .build();
@ -1237,7 +1236,6 @@ public class ApiDefinitionService {
.context(context) .context(context)
.testId(scheduleId) .testId(scheduleId)
.subject(Translator.get("swagger_url_scheduled_import_notification")) .subject(Translator.get("swagger_url_scheduled_import_notification"))
.successMailTemplate("SwaggerImport")
.paramMap(paramMap) .paramMap(paramMap)
.event(NoticeConstants.Event.EXECUTE_SUCCESSFUL) .event(NoticeConstants.Event.EXECUTE_SUCCESSFUL)
.build(); .build();

View File

@ -509,8 +509,6 @@ public class ApiScenarioReportService {
.operator(userId) .operator(userId)
.context(context) .context(context)
.subject("接口自动化通知") .subject("接口自动化通知")
.successMailTemplate("api/ScenarioResultSuccess")
.failedMailTemplate("api/ScenarioResultFailed")
.paramMap(paramMap) .paramMap(paramMap)
.event(event) .event(event)
.build(); .build();

View File

@ -251,9 +251,7 @@ public class TestResultService {
NoticeModel noticeModel = NoticeModel.builder() NoticeModel noticeModel = NoticeModel.builder()
.operator(report.getUserId()) .operator(report.getUserId())
.successContext(successContext) .successContext(successContext)
.successMailTemplate("ApiSuccessfulNotification")
.failedContext(failedContext) .failedContext(failedContext)
.failedMailTemplate("ApiFailedNotification")
.testId(testId) .testId(testId)
.status(report.getStatus()) .status(report.getStatus())
.event(event) .event(event)

View File

@ -37,14 +37,4 @@ public @interface SendNotice {
String successContext() default ""; String successContext() default "";
String failedContext() default ""; String failedContext() default "";
/**
* html 消息模版
*/
String mailTemplate() default "";
String failedMailTemplate() default "";
String successMailTemplate() default "";
} }

View File

@ -87,45 +87,6 @@ public abstract class AbstractNoticeSender implements NoticeSender {
} }
return getContent(context, noticeModel.getParamMap()); 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<String, Object> context) { protected String getContent(String template, Map<String, Object> context) {
// 处理 null // 处理 null
context.forEach((k, v) -> { context.forEach((k, v) -> {

View File

@ -42,7 +42,6 @@ public class AfterReturningNoticeSendService {
.operator(sessionUser.getId()) .operator(sessionUser.getId())
.context(context) .context(context)
.subject(sendNotice.subject()) .subject(sendNotice.subject())
.mailTemplate(sendNotice.mailTemplate())
.paramMap(paramMap) .paramMap(paramMap)
.event(sendNotice.event()) .event(sendNotice.event())
.status((String) paramMap.get("status")) .status((String) paramMap.get("status"))

View File

@ -38,13 +38,6 @@ public class NoticeModel implements Serializable {
private String successContext; private String successContext;
private String failedContext; private String failedContext;
/**
* html 消息模版
*/
private String mailTemplate;
private String failedMailTemplate;
private String successMailTemplate;
/** /**
* 保存特殊的用户 * 保存特殊的用户
*/ */

View File

@ -139,7 +139,7 @@ public class MailNoticeSender extends AbstractNoticeSender {
@Override @Override
public void send(MessageDetail messageDetail, NoticeModel noticeModel) { public void send(MessageDetail messageDetail, NoticeModel noticeModel) {
String context = super.getHtmlContext(messageDetail, noticeModel); String context = super.getContext(messageDetail, noticeModel);
try { try {
sendMail(context, noticeModel); sendMail(context, noticeModel);
LogUtil.debug("发送邮件结束"); LogUtil.debug("发送邮件结束");

View File

@ -53,7 +53,7 @@ public class PerformanceReportController {
@RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_DELETE) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_DELETE)
@MsAuditLog(module = OperLogModule.PERFORMANCE_TEST_REPORT, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#reportId)", msClass = PerformanceReportService.class) @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, @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) { public void deleteReport(@PathVariable String reportId) {
performanceReportService.deleteReport(reportId); performanceReportService.deleteReport(reportId);
} }
@ -139,7 +139,7 @@ public class PerformanceReportController {
@RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_REPORT_READ_DELETE) @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) @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, @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) { public void deleteReportBatch(@RequestBody DeleteReportRequest reportRequest) {
performanceReportService.deleteReportBatch(reportRequest); performanceReportService.deleteReportBatch(reportRequest);
} }

View File

@ -88,7 +88,7 @@ public class PerformanceTestController {
@RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_CREATE) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_CREATE)
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
@SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.CREATE, @SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.CREATE,
mailTemplate = "performance/TestCreate", subject = "性能测试通知") subject = "性能测试通知")
public LoadTest save( public LoadTest save(
@RequestPart("request") SaveTestPlanRequest request, @RequestPart("request") SaveTestPlanRequest request,
@RequestPart(value = "file", required = false) List<MultipartFile> files @RequestPart(value = "file", required = false) List<MultipartFile> 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) @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) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_EDIT)
@CacheNode // 把监控节点缓存起来 @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( public LoadTest edit(
@RequestPart("request") EditTestPlanRequest request, @RequestPart("request") EditTestPlanRequest request,
@RequestPart(value = "file", required = false) List<MultipartFile> files @RequestPart(value = "file", required = false) List<MultipartFile> files
@ -166,7 +166,7 @@ public class PerformanceTestController {
@RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_DELETE) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_DELETE)
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
@SendNotice(taskType = NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, event = NoticeConstants.Event.DELETE, @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) { public void delete(@RequestBody DeleteTestPlanRequest request) {
checkPermissionService.checkPerformanceTestOwner(request.getId()); checkPermissionService.checkPerformanceTestOwner(request.getId());
performanceTestService.delete(request); performanceTestService.delete(request);

View File

@ -76,9 +76,7 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent {
NoticeModel noticeModel = NoticeModel.builder() NoticeModel noticeModel = NoticeModel.builder()
.operator(loadTestReport.getUserId()) .operator(loadTestReport.getUserId())
.successContext(successContext) .successContext(successContext)
.successMailTemplate("PerformanceSuccessNotification")
.failedContext(failedContext) .failedContext(failedContext)
.failedMailTemplate("PerformanceFailedNotification")
.testId(loadTestReport.getTestId()) .testId(loadTestReport.getTestId())
.status(loadTestReport.getStatus()) .status(loadTestReport.getStatus())
.subject(subject) .subject(subject)
@ -92,7 +90,6 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent {
NoticeModel noticeModel2 = NoticeModel.builder() NoticeModel noticeModel2 = NoticeModel.builder()
.operator(loadTestReport.getUserId()) .operator(loadTestReport.getUserId())
.context(context) .context(context)
.mailTemplate("performance/TestResult")
.testId(loadTestReport.getTestId()) .testId(loadTestReport.getTestId())
.status(loadTestReport.getStatus()) .status(loadTestReport.getStatus())
.subject(subject) .subject(subject)

View File

@ -30,7 +30,7 @@ public class IssueCommentController {
@PostMapping("/save") @PostMapping("/save")
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT)
@SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#targetClass.get(#request.issuesId)", targetClass = IssuesService.class, @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) { public IssueComment saveComment(@RequestBody IssuesRelevanceRequest request) {
request.setId(UUID.randomUUID().toString()); request.setId(UUID.randomUUID().toString());
return issueCommentService.saveComment(request); return issueCommentService.saveComment(request);

View File

@ -61,7 +61,7 @@ public class IssuesController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ_CREATE) @RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ_CREATE)
@MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#issuesRequest)", msClass = IssuesService.class) @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#issuesRequest)", msClass = IssuesService.class)
@SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#issuesRequest", @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) { public IssuesWithBLOBs addIssues(@RequestBody IssuesUpdateRequest issuesRequest) {
return issuesService.addIssues(issuesRequest); return issuesService.addIssues(issuesRequest);
} }
@ -70,7 +70,7 @@ public class IssuesController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ_EDIT) @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) @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", @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) { public void updateIssues(@RequestBody IssuesUpdateRequest issuesRequest) {
issuesService.updateIssues(issuesRequest); issuesService.updateIssues(issuesRequest);
} }
@ -115,7 +115,7 @@ public class IssuesController {
@GetMapping("/delete/{id}") @GetMapping("/delete/{id}")
@MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssuesService.class) @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) { public void delete(@PathVariable String id) {
issuesService.delete(id); issuesService.delete(id);
} }

View File

@ -29,7 +29,7 @@ public class TestCaseCommentController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) @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) @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, @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) { public TestCaseComment saveComment(@RequestBody SaveCommentRequest request) {
request.setId(UUID.randomUUID().toString()); request.setId(UUID.randomUUID().toString());
return testCaseCommentService.saveComment(request); return testCaseCommentService.saveComment(request);

View File

@ -196,7 +196,7 @@ public class TestCaseController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_CREATE) @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) @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, @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<MultipartFile> files) { public TestCase addTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List<MultipartFile> files) {
if (StringUtils.isBlank(request.getId())) { if (StringUtils.isBlank(request.getId())) {
//新增 后端生成 id //新增 后端生成 id
@ -216,7 +216,7 @@ public class TestCaseController {
@PostMapping(value = "/edit", consumes = {"multipart/form-data"}) @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) @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, @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<MultipartFile> files) { public TestCase editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List<MultipartFile> files) {
return testCaseService.edit(request, files); return testCaseService.edit(request, files);
} }
@ -237,7 +237,7 @@ public class TestCaseController {
@PostMapping("/deleteToGc/{testCaseId}") @PostMapping("/deleteToGc/{testCaseId}")
@MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#testCaseId)", msClass = TestCaseService.class) @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, @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) { public int deleteToGC(@PathVariable String testCaseId) {
checkPermissionService.checkTestCaseOwner(testCaseId); checkPermissionService.checkTestCaseOwner(testCaseId);
return testCaseService.deleteTestCaseToGc(testCaseId); return testCaseService.deleteTestCaseToGc(testCaseId);
@ -246,7 +246,7 @@ public class TestCaseController {
@GetMapping("/deletePublic/{versionId}/{refId}") @GetMapping("/deletePublic/{versionId}/{refId}")
@MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#testCaseId)", msClass = TestCaseService.class) @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, @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) { public void deletePublic(@PathVariable String versionId, @PathVariable String refId) {
testCaseService.deleteTestCasePublic(versionId, refId); testCaseService.deleteTestCasePublic(versionId, refId);
} }
@ -289,7 +289,7 @@ public class TestCaseController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT) @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) @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, @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) { public void editTestCaseBath(@RequestBody TestCaseBatchRequest request) {
testCaseService.editTestCaseBath(request); testCaseService.editTestCaseBath(request);
} }
@ -305,7 +305,7 @@ public class TestCaseController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT) @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) @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, @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) { public void copyTestCaseBathPublic(@RequestBody TestCaseBatchRequest request) {
testCaseService.copyTestCaseBathPublic(request); testCaseService.copyTestCaseBathPublic(request);
} }
@ -322,7 +322,7 @@ public class TestCaseController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_DELETE) @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) @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, @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) { public void deleteToGcBatch(@RequestBody TestCaseBatchRequest request) {
testCaseService.deleteToGcBatch(request.getIds()); testCaseService.deleteToGcBatch(request.getIds());
} }
@ -331,7 +331,7 @@ public class TestCaseController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_DELETE) @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) @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, @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) { public void deleteToGcBatchPublic(@RequestBody TestCaseBatchRequest request) {
testCaseService.deleteToGcBatchPublic(request); testCaseService.deleteToGcBatchPublic(request);
} }

View File

@ -53,7 +53,7 @@ public class TestCaseReviewController {
@PostMapping("/save") @PostMapping("/save")
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_CREATE) @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) @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) { public TestCaseReview saveCaseReview(@RequestBody SaveTestCaseReviewRequest reviewRequest) {
reviewRequest.setId(UUID.randomUUID().toString()); reviewRequest.setId(UUID.randomUUID().toString());
return testCaseReviewService.saveTestCaseReview(reviewRequest); return testCaseReviewService.saveTestCaseReview(reviewRequest);
@ -85,7 +85,7 @@ public class TestCaseReviewController {
@PostMapping("/edit") @PostMapping("/edit")
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_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) @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) { public TestCaseReview editCaseReview(@RequestBody SaveTestCaseReviewRequest testCaseReview) {
return testCaseReviewService.editCaseReview(testCaseReview); return testCaseReviewService.editCaseReview(testCaseReview);
} }
@ -94,7 +94,7 @@ public class TestCaseReviewController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_DELETE) @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_DELETE)
@MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#reviewId)", msClass = TestCaseReviewService.class) @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, @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) { public void deleteCaseReview(@PathVariable String reviewId) {
checkPermissionService.checkTestReviewOwner(reviewId); checkPermissionService.checkTestReviewOwner(reviewId);
testCaseReviewService.deleteCaseReview(reviewId); testCaseReviewService.deleteCaseReview(reviewId);
@ -157,7 +157,7 @@ public class TestCaseReviewController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) @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) @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, @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) { public TestCaseComment saveComment(@RequestBody SaveCommentRequest request) {
request.setId(UUID.randomUUID().toString()); request.setId(UUID.randomUUID().toString());
return testCaseCommentService.saveComment(request); return testCaseCommentService.saveComment(request);

View File

@ -102,7 +102,7 @@ public class TestPlanController {
@PostMapping("/add") @PostMapping("/add")
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_CREATE) @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) @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) { public TestPlan addTestPlan(@RequestBody AddTestPlanRequest testPlan) {
testPlan.setId(UUID.randomUUID().toString()); testPlan.setId(UUID.randomUUID().toString());
return testPlanService.addTestPlan(testPlan); return testPlanService.addTestPlan(testPlan);
@ -111,7 +111,7 @@ public class TestPlanController {
@PostMapping("/edit") @PostMapping("/edit")
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_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) @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) { public TestPlan editTestPlan(@RequestBody AddTestPlanRequest testPlanDTO) {
return testPlanService.editTestPlanWithRequest(testPlanDTO); return testPlanService.editTestPlanWithRequest(testPlanDTO);
} }
@ -141,7 +141,7 @@ public class TestPlanController {
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_DELETE) @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_DELETE)
@MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testPlanId)", msClass = TestPlanService.class) @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, @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) { public int deleteTestPlan(@PathVariable String testPlanId) {
checkPermissionService.checkTestPlanOwner(testPlanId); checkPermissionService.checkTestPlanOwner(testPlanId);
return testPlanService.deleteTestPlan(testPlanId); return testPlanService.deleteTestPlan(testPlanId);
@ -184,7 +184,7 @@ public class TestPlanController {
} }
@PostMapping("/copy/{id}") @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) { public TestPlan copy(@PathVariable String id) {
return testPlanService.copy(id); return testPlanService.copy(id);
} }
@ -261,7 +261,7 @@ public class TestPlanController {
} }
@PostMapping(value = "/schedule/updateEnableByPrimyKey/disable") @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) { public Schedule disableSchedule(@RequestBody ScheduleInfoRequest request) {
Schedule schedule = scheduleService.getSchedule(request.getTaskID()); Schedule schedule = scheduleService.getSchedule(request.getTaskID());
schedule.setEnable(false); schedule.setEnable(false);

View File

@ -61,7 +61,7 @@ public class TestPlanReportController {
@PostMapping("/delete") @PostMapping("/delete")
@MsAuditLog(module = OperLogModule.TRACK_REPORT, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testPlanReportIdList)", msClass = TestPlanReportService.class) @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, @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<String> testPlanReportIdList) { public void delete(@RequestBody List<String> testPlanReportIdList) {
testPlanReportService.delete(testPlanReportIdList); testPlanReportService.delete(testPlanReportIdList);
} }

View File

@ -419,7 +419,6 @@ public class TestCaseReviewService {
.operator(SessionUtils.getUserId()) .operator(SessionUtils.getUserId())
.context(context) .context(context)
.subject("测试评审通知") .subject("测试评审通知")
.mailTemplate("track/ReviewEnd")
.paramMap(paramMap) .paramMap(paramMap)
.event(NoticeConstants.Event.COMPLETE) .event(NoticeConstants.Event.COMPLETE)
.status(TestCaseReviewStatus.Completed.name()) .status(TestCaseReviewStatus.Completed.name())

View File

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<div style="text-align: left">
<p>尊敬的用户:</p>
<p style="margin-left: 60px">您好:
</div>
<div style="margin-left: 100px">
<p>${operator}执行接口测试失败: ${name}</p>
报告:
<a href="${reportUrl}">${reportUrl}</a>
</div>
</div>
</body>
</html>

View File

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div style="text-align: left">
<p>尊敬的用户:</p>
<p style="margin-left: 60px">您好:
</div>
<div style="margin-left: 100px">
<p>${operator}执行接口测试成功: ${name}</p>
报告:
<a href="${reportUrl}">${reportUrl}</a>
</div>
</body>
</html>

View File

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<div style="text-align: left">
<p>尊敬的用户:</p>
<p style="margin-left: 60px">您好:
</div>
<div style="margin-left: 100px">
<p>您所执行的 ${name} 启动失败<br/>
</div>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body style="text-align: left">
<div style="margin-left: 100px">
${operator}执行性能测试成功: ${name}, 报告: ${reportUrl}
</div>
</body>
</html>

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left"> ${maintainer}为 <br/>
${testCaseName}<br/>
添加评论:${description}<br/>
点击下面链接进入用例评审页面</p>
<a href="${url}/#/track/review/view/${id}">${url}/#/track/review/view/${id}</a>
</div>
</body>
</html>

View File

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">
${url}<br>
导入成功!
</p>
</div>
</body>
</html>

View File

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">
${url}<br>
导入失败!
</p>
</div>
</body>
</html>

View File

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<div style="text-align: left">
<p>尊敬的用户:</p>
<p style="margin-left: 60px">您好:
</div>
<div style="margin-left: 100px">
<p>${operator}执行的 ${name} 测试计划运行失败<br/>
请点击下面链接进入测试报告页面</p>
<a href="${planShareUrl}">${planShareUrl}</a>
</div>
</div>
</body>
</html>

View File

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div style="text-align: left">
<p>尊敬的用户:</p>
<p style="margin-left: 60px">您好:
</div>
<div style="margin-left: 100px">
<p>${operator}执行的 ${name} 测试计划运行成功<br/>
请点击下面链接进入测试报告页面</p>
<a href="${planShareUrl}">${planShareUrl}</a>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}创建了接口自动化: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}删除了接口自动化: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}更新了接口自动化: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}创建了接口用例: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}删除了接口用例: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}执行接口用例失败: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}执行接口用例成功: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}更新了接口用例: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}创建了接口定义: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}删除了接口定义: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}更新了接口定义: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}删除了报告: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}执行接口自动化失败: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}执行接口自动化成功: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}关闭了定时任务: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}删除了性能测试报告: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}创建了性能测试: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}删除了性能测试: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}执行性能测试: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}更新了性能测试: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}更新了缺陷评论: ${title}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}创建了缺陷: ${title}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}删除了缺陷: ${title}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}更新了缺陷: ${title}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}删除了报告: ${name}</p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">${operator}删除了用例评审:${name}</p>
</div>
</body>
</html>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">${operator}完成了测试评审: ${name} <br>
点击下面链接进入用例评审页面</p>
<a href="${url}/#/track/review/view">${url}/#/track/review/view</a>
</div>
</body>
</html>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">${operator}发起了测试评审:${name}<br>
点击下面链接进入评审页面进行审核</p>
<a href="${url}/#/track/review/view/${id}">${url}/#/track/review/view/${id}</a>
</div>
</body>
</html>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">${operator}更新了测试评审: ${name} <br>
点击下面链接进入用例评审页面</p>
<a href="${url}/#/track/review/view">${url}/#/track/review/view</a>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p>${operator}关闭了定时任务: ${name}</p>
</div>
</body>
</html>

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">
${operator}评论了测试用例: ${name}
</p>
点击下面链接进入测试用例
<a href="${url}/#/track/case/all">${url}/#/track/case/all</a>
</div>
</body>
</html>

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">
${operator}创建了测试用例: ${name}
</p>
点击下面链接进入测试用例
<a href="${url}/#/track/case/all">${url}/#/track/case/all</a>
</div>
</body>
</html>

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">
${operator}删除了测试用例: ${name}
</p>
点击下面链接进入测试用例
<a href="${url}/#/track/case/all">${url}/#/track/case/all</a>
</div>
</body>
</html>

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">
${operator}修改了测试用例: ${name}
</p>
点击下面链接进入测试用例
<a href="${url}/#/track/case/all">${url}/#/track/case/all</a>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">${operator}完成了测试计划: ${name}<br>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">${operator}删除了测试计划: ${name} </p>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">${operator}创建了测试计划${name}<br>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
<div>
<p style="text-align: left">${operator}更新了测试计划: ${name}<br>
</div>
</body>
</html>

View File

@ -144,21 +144,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: '<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
' <meta charset="UTF-8">\n' +
' <title>MeterSphere</title>\n' +
'</head>\n' +
'<body>\n' +
'<div>\n' +
' <div style="margin-left: 100px">\n' +
' ${operator}执行接口测试成功: ${name}, 报告: ${reportUrl}' +
' </div>\n' +
'\n' +
'</div>\n' +
'</body>\n' +
'</html>',
robotTitle: "${operator}执行接口测试成功: ${name}, 报告: ${reportUrl}", robotTitle: "${operator}执行接口测试成功: ${name}, 报告: ${reportUrl}",
scheduleTask: [{ scheduleTask: [{
taskType: "scheduleTask", taskType: "scheduleTask",
@ -397,21 +382,18 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'EXECUTE_SUCCESSFUL': case 'EXECUTE_SUCCESSFUL':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'EXECUTE_FAILED': case 'EXECUTE_FAILED':
htmlTemplate = this.title.replace('成功', '失败');
robotTemplate = this.robotTitle.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
} }
} }

View File

@ -144,21 +144,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: '<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
' <meta charset="UTF-8">\n' +
' <title>MeterSphere</title>\n' +
'</head>\n' +
'<body>\n' +
'<div>\n' +
' <div style="margin-left: 100px">\n' +
' swagger:${url}导入成功 ' +
' </div>\n' +
'\n' +
'</div>\n' +
'</body>\n' +
'</html>',
robotTitle: robotTitle:
"swagger:${url}导入成功", "swagger:${url}导入成功",
scheduleTask: [{ scheduleTask: [{
@ -267,21 +252,18 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'EXECUTE_SUCCESSFUL': case 'EXECUTE_SUCCESSFUL':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'EXECUTE_FAILED': case 'EXECUTE_FAILED':
htmlTemplate = this.title.replace('成功', '失败');
robotTemplate = this.robotTitle.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
} }
}, },

View File

@ -144,21 +144,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: '<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
' <meta charset="UTF-8">\n' +
' <title>MeterSphere</title>\n' +
'</head>\n' +
'<body>\n' +
'<div>\n' +
' <div style="margin-left: 100px">\n' +
' ${operator}执行测试成功: ${name}, 报告: ${reportUrl}' +
' </div>\n' +
'\n' +
'</div>\n' +
'</body>\n' +
'</html>',
robotTitle: "${operator}执行测试成功: ${name}, 报告: ${reportUrl}", robotTitle: "${operator}执行测试成功: ${name}, 报告: ${reportUrl}",
scheduleTask: [{ scheduleTask: [{
taskType: "scheduleTask", taskType: "scheduleTask",
@ -265,21 +250,18 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'EXECUTE_SUCCESSFUL': case 'EXECUTE_SUCCESSFUL':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'EXECUTE_FAILED': case 'EXECUTE_FAILED':
htmlTemplate = this.title.replace('成功', '失败');
robotTemplate = this.robotTitle.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
} }
}, },

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}创建了接口自动化: ${name}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}创建了接口自动化: ${name}", robotTitle: "${operator}创建了接口自动化: ${name}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -391,37 +379,29 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CREATE': case 'CREATE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'UPDATE': case 'UPDATE':
htmlTemplate = this.title.replace('创建', '更新');
robotTemplate = this.robotTitle.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新');
break; break;
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
break; break;
case 'EXECUTE_SUCCESSFUL': case 'EXECUTE_SUCCESSFUL':
htmlTemplate = this.title.replace('创建', '执行')
.replace('接口自动化', '接口自动化成功');
robotTemplate = this.robotTitle.replace('创建', '执行') robotTemplate = this.robotTitle.replace('创建', '执行')
.replace('接口自动化', '接口自动化成功'); .replace('接口自动化', '接口自动化成功');
break; break;
case 'EXECUTE_FAILED': case 'EXECUTE_FAILED':
htmlTemplate = this.title.replace('创建', '执行')
.replace('接口自动化', '接口自动化失败');
robotTemplate = this.robotTitle.replace('创建', '执行') robotTemplate = this.robotTitle.replace('创建', '执行')
.replace('接口自动化', '接口自动化失败'); .replace('接口自动化', '接口自动化失败');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}创建了接口定义: ${name}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}创建了接口定义: ${name}", robotTitle: "${operator}创建了接口定义: ${name}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -451,53 +439,40 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CREATE': case 'CREATE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
this.variables = this.apiVariables; this.variables = this.apiVariables;
break; break;
case 'UPDATE': case 'UPDATE':
htmlTemplate = this.title.replace('创建', '更新');
robotTemplate = this.robotTitle.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新');
this.variables = this.apiVariables; this.variables = this.apiVariables;
break; break;
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
this.variables = this.apiVariables; this.variables = this.apiVariables;
break; break;
case 'CASE_CREATE': case 'CASE_CREATE':
htmlTemplate = this.title.replace('接口定义', '接口用例');
robotTemplate = this.robotTitle.replace('接口定义', '接口用例'); robotTemplate = this.robotTitle.replace('接口定义', '接口用例');
this.variables = this.caseVariables; this.variables = this.caseVariables;
break; break;
case 'CASE_UPDATE': case 'CASE_UPDATE':
htmlTemplate = this.title.replace('创建', '更新')
.replace('接口定义', '接口用例');
robotTemplate = this.robotTitle.replace('创建', '更新') robotTemplate = this.robotTitle.replace('创建', '更新')
.replace('接口定义', '接口用例'); .replace('接口定义', '接口用例');
this.variables = this.caseVariables; this.variables = this.caseVariables;
break; break;
case 'CASE_DELETE': case 'CASE_DELETE':
htmlTemplate = this.title.replace('创建', '删除')
.replace('接口定义', '接口用例');
robotTemplate = this.robotTitle.replace('创建', '删除') robotTemplate = this.robotTitle.replace('创建', '删除')
.replace('接口定义', '接口用例'); .replace('接口定义', '接口用例');
this.variables = this.caseVariables; this.variables = this.caseVariables;
break; break;
case 'EXECUTE_SUCCESSFUL': case 'EXECUTE_SUCCESSFUL':
htmlTemplate = this.title.replace('创建', '执行')
.replace('接口定义', '接口用例成功');
robotTemplate = this.robotTitle.replace('创建', '执行') robotTemplate = this.robotTitle.replace('创建', '执行')
.replace('接口定义', '接口用例成功'); .replace('接口定义', '接口用例成功');
this.variables = this.caseVariables; this.variables = this.caseVariables;
break; break;
case 'EXECUTE_FAILED': case 'EXECUTE_FAILED':
htmlTemplate = this.title.replace('创建', '执行')
.replace('接口定义', '接口用例失败');
robotTemplate = this.robotTitle.replace('创建', '执行') robotTemplate = this.robotTitle.replace('创建', '执行')
.replace('接口定义', '接口用例失败'); .replace('接口定义', '接口用例失败');
this.variables = this.caseVariables; this.variables = this.caseVariables;
@ -505,7 +480,7 @@ export default {
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}关闭了定时任务</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}关闭了定时任务:${issuesName}", robotTitle: "${operator}关闭了定时任务:${issuesName}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -325,17 +313,15 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CLOSE_SCHEDULE': case 'CLOSE_SCHEDULE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}删除了测试报告: ${name}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}删除了测试报告: ${name}", robotTitle: "${operator}删除了测试报告: ${name}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -324,17 +312,15 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -149,18 +149,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: '<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
' <meta charset="UTF-8">\n' +
' <title>MeterSphere</title>\n' +
'</head>\n' +
'<body>\n' +
'<div>\n' +
'${operator}执行 Jenkins 成功: ${name}' +
'</div>\n' +
'</body>\n' +
'</html>',
robotTitle: "${operator}执行 Jenkins 成功: ${name}", robotTitle: "${operator}执行 Jenkins 成功: ${name}",
jenkinsTask: [{ jenkinsTask: [{
taskType: "jenkinsTask", taskType: "jenkinsTask",
@ -260,21 +248,18 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'EXECUTE_SUCCESSFUL': case 'EXECUTE_SUCCESSFUL':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'EXECUTE_FAILED': case 'EXECUTE_FAILED':
htmlTemplate = this.title.replace('成功', '失败');
robotTemplate = this.robotTitle.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
} }
} }

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}删除了测试报告: ${name}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}删除了测试报告: ${name}", robotTitle: "${operator}删除了测试报告: ${name}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -340,17 +328,15 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'DELETE': case 'DELETE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}创建了性能测试: ${name}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}创建了性能测试: ${name}", robotTitle: "${operator}创建了性能测试: ${name}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -327,31 +315,25 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CREATE': case 'CREATE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'UPDATE': case 'UPDATE':
htmlTemplate = this.title.replace('创建', '更新');
robotTemplate = this.robotTitle.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新');
break; break;
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
break; break;
case 'EXECUTE_COMPLETED': case 'EXECUTE_COMPLETED':
htmlTemplate = this.title.replace('创建', '执行')
.replace('性能测试', '性能测试完成');
robotTemplate = this.robotTitle.replace('创建', '执行') robotTemplate = this.robotTitle.replace('创建', '执行')
.replace('性能测试', '性能测试完成'); .replace('性能测试', '性能测试完成');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}创建了缺陷:${title}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}创建了缺陷:${title}", robotTitle: "${operator}创建了缺陷:${title}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -326,25 +314,21 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CREATE': case 'CREATE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'UPDATE': case 'UPDATE':
htmlTemplate = this.title.replace('创建', '更新');
robotTemplate = this.robotTitle.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新');
break; break;
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}创建了测试用例:${name}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}创建了测试用例:${name}", robotTitle: "${operator}创建了测试用例:${name}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -379,29 +367,24 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CREATE': case 'CREATE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'UPDATE': case 'UPDATE':
htmlTemplate = this.title.replace('创建', '更新');
robotTemplate = this.robotTitle.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新');
break; break;
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
break; break;
case 'COMMENT': case 'COMMENT':
htmlTemplate = this.title.replace('创建', '评论');
robotTemplate = this.robotTitle.replace('创建', '评论'); robotTemplate = this.robotTitle.replace('创建', '评论');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -147,19 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p style=\"text-align: left\">${operator} 创建了测试计划: ${name}<br>\n" +
" </p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator} 创建了测试计划:${name} ", robotTitle: "${operator} 创建了测试计划:${name} ",
testCasePlanTask: [{ testCasePlanTask: [{
taskType: "testPlanTask", taskType: "testPlanTask",
@ -404,33 +391,27 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CREATE': case 'CREATE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'UPDATE': case 'UPDATE':
htmlTemplate = this.title.replace('创建', '更新');
robotTemplate = this.robotTitle.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新');
break; break;
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
break; break;
case 'COMMENT': case 'COMMENT':
htmlTemplate = this.title.replace('创建', '评论');
robotTemplate = this.robotTitle.replace('创建', '评论'); robotTemplate = this.robotTitle.replace('创建', '评论');
break; break;
case "COMPLETE": case "COMPLETE":
htmlTemplate = this.title.replace('创建', '完成测试计划');
robotTemplate = this.robotTitle.replace('创建', '完成测试计划'); robotTemplate = this.robotTitle.replace('创建', '完成测试计划');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
} }
}, },

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" ${operator}创建了用例评审:${name}<br>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}创建了用例评审:${name}", robotTitle: "${operator}创建了用例评审:${name}",
reviewTask: [{ reviewTask: [{
taskType: "reviewTask", taskType: "reviewTask",
@ -375,33 +363,27 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CREATE': case 'CREATE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'UPDATE': case 'UPDATE':
htmlTemplate = this.title.replace('创建', '更新');
robotTemplate = this.robotTitle.replace('创建', '更新'); robotTemplate = this.robotTitle.replace('创建', '更新');
break; break;
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
break; break;
case 'COMMENT': case 'COMMENT':
htmlTemplate = this.title.replace('创建', '评论');
robotTemplate = this.robotTitle.replace('创建', '评论'); robotTemplate = this.robotTitle.replace('创建', '评论');
break; break;
case "COMPLETE": case "COMPLETE":
htmlTemplate = this.title.replace('创建', '完成评审');
robotTemplate = this.robotTitle.replace('创建', '完成评审'); robotTemplate = this.robotTitle.replace('创建', '完成评审');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
} }
}, },

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}关闭了定时任务: ${name}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}关闭了定时任务: ${name}", robotTitle: "${operator}关闭了定时任务: ${name}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -329,17 +317,15 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'CLOSE_SCHEDULE': case 'CLOSE_SCHEDULE':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -147,18 +147,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" +
"</head>\n" +
"<body>\n" +
"<div>\n" +
" <p>${operator}删除了测试报告${name}</p>\n" +
"</div>\n" +
"</body>\n" +
"</html>",
robotTitle: "${operator}删除了测试报告${name}", robotTitle: "${operator}删除了测试报告${name}",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -331,17 +319,15 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'DELETE': case 'DELETE':
htmlTemplate = this.title.replace('创建', '删除');
robotTemplate = this.robotTitle.replace('创建', '删除'); robotTemplate = this.robotTitle.replace('创建', '删除');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
}, },
handleReceivers(row) { handleReceivers(row) {

View File

@ -144,21 +144,6 @@ export default {
data() { data() {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: '<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
' <meta charset="UTF-8">\n' +
' <title>MeterSphere</title>\n' +
'</head>\n' +
'<body>\n' +
'<div>\n' +
' <div style="margin-left: 100px">\n' +
' ${operator}执行接口测试成功: ${name}, 报告: ${planShareUrl}' +
' </div>\n' +
'\n' +
'</div>\n' +
'</body>\n' +
'</html>',
robotTitle: "${operator}执行接口测试成功: ${name}, 报告: ${planShareUrl}", robotTitle: "${operator}执行接口测试成功: ${name}, 报告: ${planShareUrl}",
scheduleTask: [{ scheduleTask: [{
taskType: "scheduleTask", taskType: "scheduleTask",
@ -360,25 +345,21 @@ export default {
}, },
handleTemplate(index, row) { handleTemplate(index, row) {
if (hasLicense()) { if (hasLicense()) {
let htmlTemplate = "";
let robotTemplate = ""; let robotTemplate = "";
switch (row.event) { switch (row.event) {
case 'EXECUTE_SUCCESSFUL': case 'EXECUTE_SUCCESSFUL':
htmlTemplate = this.title;
robotTemplate = this.robotTitle; robotTemplate = this.robotTitle;
break; break;
case 'EXECUTE_FAILED': case 'EXECUTE_FAILED':
htmlTemplate = this.title.replace('成功', '失败');
robotTemplate = this.robotTitle.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败');
break; break;
case 'COMPLETE': case 'COMPLETE':
htmlTemplate = this.title.replace('成功', '完成');
robotTemplate = this.robotTitle.replace('成功', '完成'); robotTemplate = this.robotTitle.replace('成功', '完成');
break; break;
default: default:
break; break;
} }
this.$refs.noticeTemplate.open(row, htmlTemplate, robotTemplate); this.$refs.noticeTemplate.open(row, robotTemplate);
} }
} }
} }