diff --git a/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java b/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java index 5466365ef6..7dfe08f189 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java @@ -10,6 +10,7 @@ import io.metersphere.api.dto.automation.ExecuteType; import io.metersphere.api.service.ApiScenarioReportService; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.log.annotation.MsAuditLog; @@ -44,7 +45,7 @@ public class APIScenarioReportController { } @PostMapping("/delete") - @MsAuditLog(module = "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, mailTemplate = "api/ReportDelete", subject = "接口报告通知") public void delete(@RequestBody DeleteAPIReportRequest request) { @@ -52,7 +53,7 @@ public class APIScenarioReportController { } @PostMapping("/batch/delete") - @MsAuditLog(module = "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, mailTemplate = "api/ReportDelete", subject = "接口报告通知") public void deleteAPIReportBatch(@RequestBody APIReportBatchRequest request) { diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java index dd773fdf9b..a9610d3a27 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -98,7 +98,7 @@ public class ApiAutomationController { } @PostMapping(value = "/create") - @MsAuditLog(module = "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) @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, event = NoticeConstants.Event.CREATE, mailTemplate = "api/AutomationCreate", subject = "接口自动化通知") public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles", required = false) List bodyFiles, @@ -107,7 +107,7 @@ public class ApiAutomationController { } @PostMapping(value = "/update") - @MsAuditLog(module = "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) @SendNotice(taskType = NoticeConstants.TaskType.API_AUTOMATION_TASK, event = NoticeConstants.Event.UPDATE, mailTemplate = "api/AutomationUpdate", subject = "接口自动化通知") public ApiScenario update(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "bodyFiles", required = false) List bodyFiles, @@ -122,14 +122,14 @@ public class ApiAutomationController { } @GetMapping("/delete/{id}") - @MsAuditLog(module = "api_automation", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = ApiAutomationService.class) + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = ApiAutomationService.class) @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_DELETE) public void delete(@PathVariable String id) { apiAutomationService.delete(id); } @PostMapping("/deleteBatch") - @MsAuditLog(module = "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, mailTemplate = "api/AutomationUpdate", subject = "接口自动化通知") public void deleteBatch(@RequestBody List ids) { @@ -137,13 +137,13 @@ public class ApiAutomationController { } @PostMapping("/deleteBatchByCondition") - @MsAuditLog(module = "api_automation", type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) public void deleteBatchByCondition(@RequestBody ApiScenarioBatchRequest request) { apiAutomationService.deleteBatchByCondition(request); } @PostMapping("/removeToGc") - @MsAuditLog(module = "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, event = NoticeConstants.Event.DELETE, mailTemplate = "api/AutomationDelete", subject = "接口自动化通知") public void removeToGc(@RequestBody List ids) { @@ -151,7 +151,7 @@ public class ApiAutomationController { } @PostMapping("/removeToGcByBatch") - @MsAuditLog(module = "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, event = NoticeConstants.Event.DELETE, mailTemplate = "api/AutomationDelete", subject = "接口自动化通知") public void removeToGcByBatch(@RequestBody ApiScenarioBatchRequest request) { @@ -165,7 +165,7 @@ public class ApiAutomationController { } @PostMapping("/reduction") - @MsAuditLog(module = "api_automation", type = OperLogConstants.RESTORE, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiAutomationService.class) + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.RESTORE, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiAutomationService.class) public void reduction(@RequestBody List ids) { apiAutomationService.reduction(ids); } @@ -196,7 +196,7 @@ public class ApiAutomationController { } @PostMapping(value = "/run/debug") - @MsAuditLog(module = "api_automation", type = OperLogConstants.DEBUG, title = "#request.scenarioName", sourceId = "#request.scenarioId", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.DEBUG, title = "#request.scenarioName", sourceId = "#request.scenarioId", project = "#request.projectId") public void runDebug(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "bodyFiles", required = false) List bodyFiles, @RequestPart(value = "scenarioFiles", required = false) List scenarioFiles) { if (StringUtils.isEmpty(request.getExecuteType())) { @@ -206,7 +206,7 @@ public class ApiAutomationController { } @PostMapping(value = "/run") - @MsAuditLog(module = "api_automation", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) public List run(@RequestBody RunScenarioRequest request) { if (!StringUtils.equals(request.getExecuteType(), ExecuteType.Saved.name())) { request.setExecuteType(ExecuteType.Completed.name()); @@ -217,7 +217,7 @@ public class ApiAutomationController { } @PostMapping(value = "/run/jenkins") - @MsAuditLog(module = "api_automation", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.id)", msClass = ApiAutomationService.class) + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.id)", msClass = ApiAutomationService.class) public List runByJenkins(@RequestBody RunScenarioRequest request) { request.setExecuteType(ExecuteType.Saved.name()); request.setTriggerMode(TriggerMode.API.name()); @@ -226,7 +226,7 @@ public class ApiAutomationController { } @PostMapping(value = "/run/batch") - @MsAuditLog(module = "api_automation", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.ids)", msClass = ApiAutomationService.class) public List runBatch(@RequestBody RunScenarioRequest request) { request.setExecuteType(ExecuteType.Saved.name()); request.setTriggerMode(TriggerMode.BATCH.name()); @@ -236,7 +236,7 @@ public class ApiAutomationController { @PostMapping("/batch/edit") @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EDIT) - @MsAuditLog(module = "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, mailTemplate = "api/AutomationUpdate", subject = "接口自动化通知") public void bathEdit(@RequestBody ApiScenarioBatchRequest request) { @@ -252,7 +252,7 @@ public class ApiAutomationController { @PostMapping("/batch/update/env") @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EDIT) - @MsAuditLog(module = "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) public void batchUpdateEnv(@RequestBody ApiScenarioBatchRequest request) { apiAutomationService.batchUpdateEnv(request); } @@ -268,7 +268,7 @@ public class ApiAutomationController { } @PostMapping("/relevance") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request)", msClass = ApiAutomationService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request)", msClass = ApiAutomationService.class) public void testPlanRelevance(@RequestBody ApiCaseRelevanceRequest request) { apiAutomationService.relevance(request); } @@ -310,14 +310,14 @@ public class ApiAutomationController { @PostMapping(value = "/import", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_IMPORT_SCENARIO) - @MsAuditLog(module = "api_automation", type = OperLogConstants.IMPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.IMPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public ScenarioImport scenarioImport(@RequestPart(value = "file", required = false) MultipartFile file, @RequestPart("request") ApiTestImportRequest request) { return apiAutomationService.scenarioImport(file, request); } @PostMapping(value = "/export") @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EXPORT_SCENARIO) - @MsAuditLog(module = "api_automation", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public ApiScenrioExportResult export(@RequestBody ApiScenarioBatchRequest request) { return apiAutomationService.export(request); } @@ -346,7 +346,7 @@ public class ApiAutomationController { @PostMapping(value = "/export/zip") @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EXPORT_SCENARIO) - @MsAuditLog(module = "api_automation", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public ResponseEntity downloadBodyFiles(@RequestBody ApiScenarioBatchRequest request) { byte[] bytes = apiAutomationService.exportZip(request); return ResponseEntity.ok() @@ -357,7 +357,7 @@ public class ApiAutomationController { @PostMapping(value = "/export/jmx") @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EXPORT_SCENARIO) - @MsAuditLog(module = "api_automation", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public List exportJmx(@RequestBody ApiScenarioBatchRequest request) { return apiAutomationService.exportJmx(request); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java index 42194a4acc..86ed15281b 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java @@ -22,6 +22,7 @@ import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs; import io.metersphere.base.domain.Schedule; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.json.JSONSchemaGenerator; import io.metersphere.commons.json.JSONToDocumentUtils; @@ -101,7 +102,7 @@ public class ApiDefinitionController { @PostMapping(value = "/create", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API) - @MsAuditLog(module = "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 = "接口定义通知") public ApiDefinitionWithBLOBs create(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { checkPermissionService.checkProjectOwner(request.getProjectId()); @@ -110,7 +111,7 @@ public class ApiDefinitionController { @PostMapping(value = "/update", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_EDIT_API) - @MsAuditLog(module = "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 = "接口定义通知") public ApiDefinitionWithBLOBs update(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { checkPermissionService.checkProjectOwner(request.getProjectId()); @@ -119,14 +120,14 @@ public class ApiDefinitionController { @GetMapping("/delete/{id}") @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API) - @MsAuditLog(module = "api_definition", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = ApiDefinitionService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = ApiDefinitionService.class) public void delete(@PathVariable String id) { apiDefinitionService.delete(id); } @PostMapping("/deleteBatch") @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API) - @MsAuditLog(module = "api_definition", type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiDefinitionService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiDefinitionService.class) public void deleteBatch(@RequestBody List ids) { apiDefinitionService.deleteBatch(ids); } @@ -141,14 +142,14 @@ public class ApiDefinitionController { } @PostMapping("/deleteBatchByParams") - @MsAuditLog(module = "api_definition", type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiDefinitionService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiDefinitionService.class) public void deleteBatchByParams(@RequestBody ApiBatchRequest request) { apiDefinitionService.deleteByParams(request); } @PostMapping("/removeToGc") @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API) - @MsAuditLog(module = "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, event = NoticeConstants.Event.DELETE, mailTemplate = "api/DefinitionDelete", subject = "接口定义通知") public void removeToGc(@RequestBody List ids) { @@ -157,7 +158,7 @@ public class ApiDefinitionController { @PostMapping("/removeToGcByParams") @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_DELETE_API) - @MsAuditLog(module = "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, mailTemplate = "api/DefinitionUpdate", subject = "接口定义通知") public void removeToGcByParams(@RequestBody ApiBatchRequest request) { @@ -165,7 +166,7 @@ public class ApiDefinitionController { } @PostMapping("/reduction") - @MsAuditLog(module = "api_definition", type = OperLogConstants.RESTORE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiDefinitionService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.RESTORE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = ApiDefinitionService.class) public void reduction(@RequestBody ApiBatchRequest request) { apiDefinitionService.reduction(request); } @@ -177,14 +178,14 @@ public class ApiDefinitionController { } @PostMapping(value = "/run/debug", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "api_definition", type = OperLogConstants.DEBUG, title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.DEBUG, title = "#request.name", project = "#request.projectId") public MsExecResponseDTO runDebug(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { request.setDebug(true); return apiDefinitionService.run(request, bodyFiles); } @PostMapping(value = "/run", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "api_definition", type = OperLogConstants.EXECUTE, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.EXECUTE, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public MsExecResponseDTO run(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { request.setReportId(null); return apiDefinitionService.run(request, bodyFiles); @@ -212,21 +213,21 @@ public class ApiDefinitionController { @PostMapping(value = "/import", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_IMPORT_API) - @MsAuditLog(module = "api_definition", type = OperLogConstants.IMPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.IMPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public ApiDefinitionImport testCaseImport(@RequestPart(value = "file", required = false) MultipartFile file, @RequestPart("request") ApiTestImportRequest request) { return apiDefinitionService.apiTestImport(file, request); } @PostMapping(value = "/export/{type}") @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_EXPORT_API) - @MsAuditLog(module = "api_definition", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public ApiExportResult export(@RequestBody ApiBatchRequest request, @PathVariable String type) { return apiDefinitionService.export(request, type); } //定时任务创建 @PostMapping(value = "/schedule/create") - @MsAuditLog(module = "api_definition", type = OperLogConstants.CREATE, title = "#request.scheduleFrom", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.CREATE, title = "#request.scheduleFrom", project = "#request.projectId") public void createSchedule(@RequestBody ScheduleRequest request) { apiDefinitionService.createSchedule(request); } @@ -273,7 +274,7 @@ public class ApiDefinitionController { @PostMapping("/batch/editByParams") @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_EDIT_API) - @MsAuditLog(module = "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, mailTemplate = "api/DefinitionUpdate", subject = "接口定义通知") public void editByParams(@RequestBody ApiBatchRequest request) { @@ -282,13 +283,13 @@ public class ApiDefinitionController { @PostMapping("/batch/copy") @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_COPY_API) - @MsAuditLog(module = "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) public void batchCopy(@RequestBody ApiBatchRequest request) { apiDefinitionService.batchCopy(request); } @PostMapping("/relevance") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request)", msClass = ApiDefinitionService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request)", msClass = ApiDefinitionService.class) public void testPlanRelevance(@RequestBody ApiCaseRelevanceRequest request) { apiDefinitionService.testPlanRelevance(request); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiModuleController.java b/backend/src/main/java/io/metersphere/api/controller/ApiModuleController.java index ec23f981a6..36585ceedc 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiModuleController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiModuleController.java @@ -5,6 +5,7 @@ import io.metersphere.api.dto.definition.DragModuleRequest; import io.metersphere.api.service.ApiModuleService; import io.metersphere.base.domain.ApiModule; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.ApiDefinitionDefaultApiTypeUtil; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.log.annotation.MsAuditLog; @@ -70,26 +71,26 @@ public class ApiModuleController { } @PostMapping("/add") - @MsAuditLog(module = "api_definition", type = OperLogConstants.CREATE, title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = ApiModuleService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.CREATE, title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = ApiModuleService.class) public String addNode(@RequestBody ApiModule node) { return apiModuleService.addNode(node); } @PostMapping("/edit") - @MsAuditLog(module = "api_definition", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = ApiModuleService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = ApiModuleService.class) public int editNode(@RequestBody DragModuleRequest node) { return apiModuleService.editNode(node); } @PostMapping("/delete") - @MsAuditLog(module = "api_definition", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#nodeIds)", msClass = ApiModuleService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#nodeIds)", msClass = ApiModuleService.class) public int deleteNode(@RequestBody List nodeIds) { //nodeIds 包含删除节点ID及其所有子节点ID return apiModuleService.deleteNode(nodeIds); } @PostMapping("/drag") - @MsAuditLog(module = "api_definition", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = ApiModuleService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = ApiModuleService.class) public void dragNode(@RequestBody DragModuleRequest node) { apiModuleService.dragNode(node); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiScenarioModuleController.java b/backend/src/main/java/io/metersphere/api/controller/ApiScenarioModuleController.java index df467483a2..226f2e5431 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiScenarioModuleController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiScenarioModuleController.java @@ -5,6 +5,7 @@ import io.metersphere.api.dto.automation.DragApiScenarioModuleRequest; import io.metersphere.api.service.ApiScenarioModuleService; import io.metersphere.base.domain.ApiScenarioModule; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.service.CheckPermissionService; import org.springframework.web.bind.annotation.*; @@ -46,14 +47,14 @@ public class ApiScenarioModuleController { } @PostMapping("/delete") - @MsAuditLog(module = "api_automation", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#nodeIds)", msClass = ApiScenarioModuleService.class) + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#nodeIds)", msClass = ApiScenarioModuleService.class) public int deleteNode(@RequestBody List nodeIds) { //nodeIds 包含删除节点ID及其所有子节点ID return apiScenarioModuleService.deleteNode(nodeIds); } @PostMapping("/drag") - @MsAuditLog(module = "api_automation", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = ApiScenarioModuleService.class) + @MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = ApiScenarioModuleService.class) public void dragNode(@RequestBody DragApiScenarioModuleRequest node) { apiScenarioModuleService.dragNode(node); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java b/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java index b6e7c3eebb..37dcfc4804 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiTestCaseController.java @@ -14,6 +14,7 @@ import io.metersphere.base.domain.ApiTestCaseWithBLOBs; import io.metersphere.base.domain.ApiTestEnvironment; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.ReportTriggerMode; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -99,27 +100,27 @@ public class ApiTestCaseController { } @PostMapping(value = "/create", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "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 = "接口用例通知") public ApiTestCase create(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { return apiTestCaseService.create(request, bodyFiles); } @PostMapping(value = "/update", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "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 = "接口用例通知") public ApiTestCase update(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { return apiTestCaseService.update(request, bodyFiles); } @GetMapping("/delete/{id}") - @MsAuditLog(module = "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) public void delete(@PathVariable String id) { apiTestCaseService.delete(id); } @GetMapping("/deleteToGc/{id}") - @MsAuditLog(module = "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, mailTemplate = "api/CaseDelete", subject = "接口用例通知") public void deleteToGc(@PathVariable String id) { @@ -127,7 +128,7 @@ public class ApiTestCaseController { } @PostMapping("/removeToGc") - @MsAuditLog(module = "api_definition_case", type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiTestCaseService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.GC, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiTestCaseService.class) public void removeToGc(@RequestBody List ids) { apiTestCaseService.removeToGc(ids); } @@ -143,7 +144,7 @@ public class ApiTestCaseController { } @PostMapping("/batch/editByParam") - @MsAuditLog(module = "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, mailTemplate = "api/CaseUpdate", subject = "接口用例通知") public void editApiBathByParam(@RequestBody ApiTestBatchRequest request) { @@ -156,26 +157,26 @@ public class ApiTestCaseController { } @PostMapping("/reduction") - @MsAuditLog(module = "api_definition_case", type = OperLogConstants.RESTORE, beforeEvent = "#msClass.getLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = ApiTestCaseService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.RESTORE, beforeEvent = "#msClass.getLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = ApiTestCaseService.class) public List reduction(@RequestBody ApiTestBatchRequest request) { List cannotReductionTestCaseApiName = apiTestCaseService.reduction(request); return cannotReductionTestCaseApiName; } @PostMapping("/deleteBatch") - @MsAuditLog(module = "api_definition_case", type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiTestCaseService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#ids)", msClass = ApiTestCaseService.class) public void deleteBatch(@RequestBody List ids) { apiTestCaseService.deleteBatch(ids); } @PostMapping("/deleteBatchByParam") - @MsAuditLog(module = "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) public void deleteBatchByParam(@RequestBody ApiTestBatchRequest request) { apiTestCaseService.deleteBatchByParam(request); } @PostMapping("/deleteToGcByParam") - @MsAuditLog(module = "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, mailTemplate = "api/CaseDelete", subject = "接口用例通知") public void deleteToGcByParam(@RequestBody ApiTestBatchRequest request) { @@ -198,14 +199,14 @@ public class ApiTestCaseController { } @PostMapping(value = "/batch/run") - @MsAuditLog(module = "api_definition_case", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.caseId)", msClass = ApiTestCaseService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.caseId)", msClass = ApiTestCaseService.class) public void batchRun(@RequestBody ApiCaseRunRequest request) { request.setTriggerMode(ReportTriggerMode.BATCH.name()); apiCaseExecuteService.run(request); } @PostMapping(value = "/jenkins/run") - @MsAuditLog(module = "api_definition_case", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.caseId)", msClass = ApiTestCaseService.class) + @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.caseId)", msClass = ApiTestCaseService.class) public MsExecResponseDTO jenkinsRun(@RequestBody RunCaseRequest request) { return apiExecuteService.jenkinsRun(request); } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiTestEnvironmentController.java b/backend/src/main/java/io/metersphere/api/controller/ApiTestEnvironmentController.java index a5cfc101ff..23ffaa1a8c 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiTestEnvironmentController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiTestEnvironmentController.java @@ -8,6 +8,7 @@ import io.metersphere.api.service.ApiTestEnvironmentService; import io.metersphere.api.service.CommandService; import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.EnvironmentRequest; @@ -58,19 +59,19 @@ public class ApiTestEnvironmentController { } @PostMapping("/add") - @MsAuditLog(module = "project_environment_setting", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#apiTestEnvironmentWithBLOBs.id)", msClass = ApiTestEnvironmentService.class) + @MsAuditLog(module = OperLogModule.PROJECT_ENVIRONMENT_SETTING, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#apiTestEnvironmentWithBLOBs.id)", msClass = ApiTestEnvironmentService.class) public String create(@RequestPart("request") ApiTestEnvironmentDTO apiTestEnvironmentWithBLOBs, @RequestPart(value = "files", required = false) List sslFiles) { return apiTestEnvironmentService.add(apiTestEnvironmentWithBLOBs, sslFiles); } @PostMapping(value = "/update") - @MsAuditLog(module = "project_environment_setting", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#apiTestEnvironment.id)", content = "#msClass.getLogDetails(#apiTestEnvironment.id)", msClass = ApiTestEnvironmentService.class) + @MsAuditLog(module = OperLogModule.PROJECT_ENVIRONMENT_SETTING, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#apiTestEnvironment.id)", content = "#msClass.getLogDetails(#apiTestEnvironment.id)", msClass = ApiTestEnvironmentService.class) public void update(@RequestPart("request") ApiTestEnvironmentDTO apiTestEnvironment, @RequestPart(value = "files", required = false) List sslFiles) { apiTestEnvironmentService.update(apiTestEnvironment, sslFiles); } @GetMapping("/delete/{id}") - @MsAuditLog(module = "project_environment_setting", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = ApiTestEnvironmentService.class) + @MsAuditLog(module = OperLogModule.PROJECT_ENVIRONMENT_SETTING, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = ApiTestEnvironmentService.class) public void delete(@PathVariable String id) { apiTestEnvironmentService.delete(id); } diff --git a/backend/src/main/java/io/metersphere/api/controller/MockConfigController.java b/backend/src/main/java/io/metersphere/api/controller/MockConfigController.java index cde61deaa6..6e7ac35c34 100644 --- a/backend/src/main/java/io/metersphere/api/controller/MockConfigController.java +++ b/backend/src/main/java/io/metersphere/api/controller/MockConfigController.java @@ -47,15 +47,6 @@ public class MockConfigController { return mockConfigService.updateMockExpectConfigStatus(request); } -// @PostMapping(value = "/create", consumes = {"multipart/form-data"}) -// @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API) -// @MsAuditLog(module = "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 = "接口定义通知") -// public ApiDefinitionWithBLOBs create(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { -// checkPermissionService.checkProjectOwner(request.getProjectId()); -// return apiDefinitionService.create(request, bodyFiles); -// } - @GetMapping("/mockExpectConfig/{id}") public MockExpectConfigResponse selectMockExpectConfig(@PathVariable String id) { MockExpectConfigWithBLOBs config = mockConfigService.findMockExpectConfigById(id); diff --git a/backend/src/main/java/io/metersphere/commons/constants/OperLogModule.java b/backend/src/main/java/io/metersphere/commons/constants/OperLogModule.java new file mode 100644 index 0000000000..ddaf050328 --- /dev/null +++ b/backend/src/main/java/io/metersphere/commons/constants/OperLogModule.java @@ -0,0 +1,37 @@ +package io.metersphere.commons.constants; + +public class OperLogModule { + public static final String SYSTEM_PARAMETER_SETTING = "SYSTEM_PARAMETER_SETTING"; + public static final String SYSTEM_TEST_RESOURCE = "SYSTEM_TEST_RESOURCE"; + public static final String SYSTEM_USER = "SYSTEM_USER"; + public static final String SYSTEM_WORKSPACE = "SYSTEM_WORKSPACE"; + public static final String WORKSPACE_TEMPLATE_SETTINGS = "WORKSPACE_TEMPLATE_SETTINGS"; + public static final String WORKSPACE_MESSAGE_SETTINGS = "WORKSPACE_MESSAGE_SETTINGS"; + public static final String WORKSPACE_TEMPLATE_SETTINGS_FIELD = "WORKSPACE_TEMPLATE_SETTINGS_FIELD"; + public static final String WORKSPACE_TEMPLATE_SETTINGS_ISSUE = "WORKSPACE_TEMPLATE_SETTINGS_ISSUE"; + public static final String WORKSPACE_SERVICE_INTEGRATION = "WORKSPACE_SERVICE_INTEGRATION"; + public static final String WORKSPACE_TEMPLATE_SETTINGS_CASE = "WORKSPACE_TEMPLATE_SETTINGS_CASE"; + public static final String WORKSPACE_MEMBER = "WORKSPACE_MEMBER"; + public static final String API_AUTOMATION = "API_AUTOMATION"; + public static final String API_AUTOMATION_REPORT = "API_AUTOMATION_REPORT"; + public static final String API_DEFINITION = "API_DEFINITION"; + public static final String API_DEFINITION_CASE = "API_DEFINITION_CASE"; + public static final String TRACK_TEST_PLAN = "TRACK_TEST_PLAN"; + public static final String TRACK_BUG = "TRACK_BUG"; + public static final String TRACK_TEST_CASE_REVIEW = "TRACK_TEST_CASE_REVIEW"; + public static final String TRACK_TEST_CASE = "TRACK_TEST_CASE"; + public static final String TRACK_REPORT = "TRACK_REPORT"; + public static final String AUTH_TITLE = "AUTH_TITLE"; + public static final String PROJECT_PROJECT_JAR = "PROJECT_PROJECT_JAR"; + public static final String PROJECT_ENVIRONMENT_SETTING = "PROJECT_ENVIRONMENT_SETTING"; + public static final String PROJECT_PROJECT_MANAGER = "PROJECT_PROJECT_MANAGER"; + public static final String PROJECT_FILE_MANAGEMENT = "PROJECT_FILE_MANAGEMENT"; + public static final String PROJECT_PROJECT_MEMBER = "PROJECT_PROJECT_MEMBER"; + public static final String PERSONAL_INFORMATION_PERSONAL_SETTINGS = "PERSONAL_INFORMATION_PERSONAL_SETTINGS"; + public static final String PERSONAL_INFORMATION_APIKEYS = "PERSONAL_INFORMATION_APIKEYS"; + public static final String GROUP_PERMISSION = "GROUP_PERMISSION"; + + + + +} diff --git a/backend/src/main/java/io/metersphere/controller/CustomFieldController.java b/backend/src/main/java/io/metersphere/controller/CustomFieldController.java index 82a3850305..6b088657c2 100644 --- a/backend/src/main/java/io/metersphere/controller/CustomFieldController.java +++ b/backend/src/main/java/io/metersphere/controller/CustomFieldController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.CustomField; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.QueryCustomFieldRequest; @@ -23,7 +24,7 @@ public class CustomFieldController { private CustomFieldService customFieldService; @PostMapping("/add") - @MsAuditLog(module = "workspace_template_settings_field", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#customField.id)", msClass = CustomFieldService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_FIELD, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#customField.id)", msClass = CustomFieldService.class) public String add(@RequestBody CustomField customField) { return customFieldService.add(customField); } @@ -40,13 +41,13 @@ public class CustomFieldController { } @GetMapping("/delete/{id}") - @MsAuditLog(module = "workspace_template_settings_field", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = CustomFieldService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_FIELD, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = CustomFieldService.class) public void delete(@PathVariable(value = "id") String id) { customFieldService.delete(id); } @PostMapping("/update") - @MsAuditLog(module = "workspace_template_settings_field", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#customField.id)", content = "#msClass.getLogDetails(#customField.id)", msClass = CustomFieldService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_FIELD, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#customField.id)", content = "#msClass.getLogDetails(#customField.id)", msClass = CustomFieldService.class) public void update(@RequestBody CustomField customField) { customFieldService.update(customField); } diff --git a/backend/src/main/java/io/metersphere/controller/GroupController.java b/backend/src/main/java/io/metersphere/controller/GroupController.java index b211491f50..ff1ed9ebbe 100644 --- a/backend/src/main/java/io/metersphere/controller/GroupController.java +++ b/backend/src/main/java/io/metersphere/controller/GroupController.java @@ -6,6 +6,7 @@ import io.metersphere.base.domain.Group; import io.metersphere.base.domain.User; import io.metersphere.base.domain.Workspace; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -54,7 +55,7 @@ public class GroupController { @PostMapping("/add") @RequiresPermissions(value = {PermissionConstants.SYSTEM_GROUP_READ_CREATE, PermissionConstants.PROJECT_GROUP_READ_CREATE}, logical = Logical.OR) - @MsAuditLog(module = "group_permission", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = GroupService.class) + @MsAuditLog(module = OperLogModule.GROUP_PERMISSION, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = GroupService.class) public Group addGroup(@RequestBody EditGroupRequest request) { request.setId(UUID.randomUUID().toString()); return groupService.addGroup(request); @@ -62,14 +63,14 @@ public class GroupController { @PostMapping("/edit") @RequiresPermissions(value = {PermissionConstants.SYSTEM_GROUP_READ_EDIT, PermissionConstants.PROJECT_GROUP_READ_EDIT}, logical = Logical.OR) - @MsAuditLog(module = "group_permission", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = GroupService.class) + @MsAuditLog(module = OperLogModule.GROUP_PERMISSION, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = GroupService.class) public void editGroup(@RequestBody EditGroupRequest request) { groupService.editGroup(request); } @GetMapping("/delete/{id}") @RequiresPermissions(value = {PermissionConstants.SYSTEM_GROUP_READ_DELETE, PermissionConstants.PROJECT_GROUP_READ_DELETE}, logical = Logical.OR) - @MsAuditLog(module = "group_permission", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = GroupService.class) + @MsAuditLog(module = OperLogModule.GROUP_PERMISSION, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = GroupService.class) public void deleteGroup(@PathVariable String id) { groupService.deleteGroup(id); } diff --git a/backend/src/main/java/io/metersphere/controller/IssueTemplateController.java b/backend/src/main/java/io/metersphere/controller/IssueTemplateController.java index 68bbc3893f..654232bdce 100644 --- a/backend/src/main/java/io/metersphere/controller/IssueTemplateController.java +++ b/backend/src/main/java/io/metersphere/controller/IssueTemplateController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.IssueTemplate; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.BaseQueryRequest; @@ -24,7 +25,7 @@ public class IssueTemplateController { private IssueTemplateService issueTemplateService; @PostMapping("/add") - @MsAuditLog(module = "workspace_template_settings_issue", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request)", msClass = IssueTemplateService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_ISSUE, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request)", msClass = IssueTemplateService.class) public void add(@RequestBody UpdateIssueTemplateRequest request) { issueTemplateService.add(request); } @@ -36,13 +37,13 @@ public class IssueTemplateController { } @GetMapping("/delete/{id}") - @MsAuditLog(module = "workspace_template_settings_issue", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssueTemplateService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_ISSUE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssueTemplateService.class) public void delete(@PathVariable(value = "id") String id) { issueTemplateService.delete(id); } @PostMapping("/update") - @MsAuditLog(module = "workspace_template_settings_issue", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id,#request.customFields)", content = "#msClass.getLogDetails(#request)", msClass = IssueTemplateService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_ISSUE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id,#request.customFields)", content = "#msClass.getLogDetails(#request)", msClass = IssueTemplateService.class) public void update(@RequestBody UpdateIssueTemplateRequest request) { issueTemplateService.update(request); } diff --git a/backend/src/main/java/io/metersphere/controller/JarConfigController.java b/backend/src/main/java/io/metersphere/controller/JarConfigController.java index f19c01b240..40bb23823f 100644 --- a/backend/src/main/java/io/metersphere/controller/JarConfigController.java +++ b/backend/src/main/java/io/metersphere/controller/JarConfigController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.JarConfig; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.log.annotation.MsAuditLog; @@ -43,19 +44,19 @@ public class JarConfigController { } @PostMapping(value = "/add", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "project_project_jar", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = JarConfigService.class) + @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_JAR, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = JarConfigService.class) public String add(@RequestPart("request") JarConfig request, @RequestPart(value = "file", required = false) MultipartFile file) { return JarConfigService.add(request, file); } @PostMapping(value = "/update", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "project_project_jar", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = JarConfigService.class) + @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_JAR, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = JarConfigService.class) public void update(@RequestPart("request") JarConfig request, @RequestPart(value = "file", required = false) MultipartFile file) { JarConfigService.update(request, file); } @GetMapping("/delete/{id}") - @MsAuditLog(module = "project_project_jar", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = JarConfigService.class) + @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_JAR, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = JarConfigService.class) public void delete(@PathVariable String id) { JarConfigService.delete(id); } diff --git a/backend/src/main/java/io/metersphere/controller/LoginController.java b/backend/src/main/java/io/metersphere/controller/LoginController.java index efe7b911f7..335888549f 100644 --- a/backend/src/main/java/io/metersphere/controller/LoginController.java +++ b/backend/src/main/java/io/metersphere/controller/LoginController.java @@ -1,6 +1,7 @@ package io.metersphere.controller; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.UserSource; import io.metersphere.commons.user.SessionUser; import io.metersphere.commons.utils.RsaKey; @@ -50,7 +51,7 @@ public class LoginController { } @PostMapping(value = "/signin") - @MsAuditLog(module = "auth_title", type = OperLogConstants.LOGIN, title = "登录") + @MsAuditLog(module = OperLogModule.AUTH_TITLE, type = OperLogConstants.LOGIN, title = "登录") public ResultHolder login(@RequestBody LoginRequest request) { SessionUser sessionUser = SessionUtils.getUser(); if (sessionUser != null) { @@ -68,7 +69,7 @@ public class LoginController { } @GetMapping(value = "/signout") - @MsAuditLog(module = "auth_title", beforeEvent = "#msClass.getUserId(id)", type = OperLogConstants.LOGIN, title = "登出", msClass = SessionUtils.class) + @MsAuditLog(module = OperLogModule.AUTH_TITLE, beforeEvent = "#msClass.getUserId(id)", type = OperLogConstants.LOGIN, title = "登出", msClass = SessionUtils.class) public ResultHolder logout() throws Exception { userService.logout(); SecurityUtils.getSubject().logout(); diff --git a/backend/src/main/java/io/metersphere/controller/ProjectController.java b/backend/src/main/java/io/metersphere/controller/ProjectController.java index 09f484d658..f25bce9dae 100644 --- a/backend/src/main/java/io/metersphere/controller/ProjectController.java +++ b/backend/src/main/java/io/metersphere/controller/ProjectController.java @@ -6,6 +6,7 @@ import io.metersphere.api.service.ApiTestEnvironmentService; import io.metersphere.base.domain.FileMetadata; import io.metersphere.base.domain.Project; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.SessionUtils; @@ -70,7 +71,7 @@ public class ProjectController { } @PostMapping("/add") - @MsAuditLog(module = "project_project_manager", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#project.id)", msClass = ProjectService.class) + @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_MANAGER, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#project.id)", msClass = ProjectService.class) public Project addProject(@RequestBody AddProjectRequest project, HttpServletRequest request) { Project returnModel = projectService.addProject(project); //创建项目的时候默认增加Mock环境 @@ -97,37 +98,37 @@ public class ProjectController { @GetMapping("/delete/{projectId}") - @MsAuditLog(module = "project_project_manager", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#projectId)", msClass = ProjectService.class) + @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_MANAGER, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#projectId)", msClass = ProjectService.class) public void deleteProject(@PathVariable(value = "projectId") String projectId) { projectService.deleteProject(projectId); } @PostMapping("/update") - @MsAuditLog(module = "project_project_manager", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#Project.id)", content = "#msClass.getLogDetails(#Project.id)", msClass = ProjectService.class) + @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_MANAGER, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#Project.id)", content = "#msClass.getLogDetails(#Project.id)", msClass = ProjectService.class) public void updateProject(@RequestBody Project Project) { projectService.updateProject(Project); } @PostMapping(value = "upload/files/{projectId}", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "project_file_management", type = OperLogConstants.IMPORT, content = "#msClass.getLogDetails(#projectId)", msClass = ProjectService.class) + @MsAuditLog(module = OperLogModule.PROJECT_FILE_MANAGEMENT, type = OperLogConstants.IMPORT, content = "#msClass.getLogDetails(#projectId)", msClass = ProjectService.class) public List uploadFiles(@PathVariable String projectId, @RequestPart(value = "file", required = false) List files) { return projectService.uploadFiles(projectId, files); } @PostMapping(value = "/update/file/{fileId}", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "project_file_management", type = OperLogConstants.IMPORT, content = "#msClass.getLogDetails(#fileId)", msClass = ProjectService.class) + @MsAuditLog(module = OperLogModule.PROJECT_FILE_MANAGEMENT, type = OperLogConstants.IMPORT, content = "#msClass.getLogDetails(#fileId)", msClass = ProjectService.class) public FileMetadata updateFile(@PathVariable String fileId, @RequestPart(value = "file", required = false) MultipartFile file) { return projectService.updateFile(fileId, file); } @GetMapping(value = "delete/file/{fileId}") - @MsAuditLog(module = "project_project_manager", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#fileId)", msClass = ProjectService.class) + @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_MANAGER, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#fileId)", msClass = ProjectService.class) public void deleteFile(@PathVariable String fileId) { projectService.deleteFile(fileId); } @PostMapping("/member/update") - @MsAuditLog(module = "project_project_member", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = ProjectService.class) + @MsAuditLog(module = OperLogModule.PROJECT_PROJECT_MEMBER, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = ProjectService.class) public void updateMember(@RequestBody WorkspaceMemberDTO memberDTO) { projectService.updateMember(memberDTO); } diff --git a/backend/src/main/java/io/metersphere/controller/ServiceIntegrationController.java b/backend/src/main/java/io/metersphere/controller/ServiceIntegrationController.java index 14e9ca3828..6cfb8dc7dc 100644 --- a/backend/src/main/java/io/metersphere/controller/ServiceIntegrationController.java +++ b/backend/src/main/java/io/metersphere/controller/ServiceIntegrationController.java @@ -2,6 +2,7 @@ package io.metersphere.controller; import io.metersphere.base.domain.ServiceIntegration; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.controller.request.IntegrationRequest; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.service.IntegrationService; @@ -18,7 +19,7 @@ public class ServiceIntegrationController { private IntegrationService integrationService; @PostMapping("/save") - @MsAuditLog(module = "workspace_service_integration", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#service.id)", msClass = IntegrationService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_SERVICE_INTEGRATION, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#service.id)", msClass = IntegrationService.class) public ServiceIntegration save(@RequestBody ServiceIntegration service) { return integrationService.save(service); } @@ -29,7 +30,7 @@ public class ServiceIntegrationController { } @PostMapping("/delete") - @MsAuditLog(module = "workspace_service_integration", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = IntegrationService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_SERVICE_INTEGRATION, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = IntegrationService.class) public void delete(@RequestBody IntegrationRequest request) { integrationService.delete(request); } diff --git a/backend/src/main/java/io/metersphere/controller/SystemParameterController.java b/backend/src/main/java/io/metersphere/controller/SystemParameterController.java index 7ae0a72970..58b090c826 100644 --- a/backend/src/main/java/io/metersphere/controller/SystemParameterController.java +++ b/backend/src/main/java/io/metersphere/controller/SystemParameterController.java @@ -4,6 +4,7 @@ import io.metersphere.base.domain.SystemHeader; import io.metersphere.base.domain.SystemParameter; import io.metersphere.base.domain.UserHeader; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.ParamConstants; import io.metersphere.controller.request.HeaderRequest; import io.metersphere.dto.BaseSystemConfigDTO; @@ -38,7 +39,7 @@ public class SystemParameterController { private ProjectService projectService; @PostMapping("/edit/email") - @MsAuditLog(module = "system_parameter_setting", type = OperLogConstants.UPDATE, title = "邮件设置", beforeEvent = "#msClass.getMailLogDetails()", content = "#msClass.getMailLogDetails()", msClass = SystemParameterService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_PARAMETER_SETTING, type = OperLogConstants.UPDATE, title = "邮件设置", beforeEvent = "#msClass.getMailLogDetails()", content = "#msClass.getMailLogDetails()", msClass = SystemParameterService.class) public void editMail(@RequestBody List systemParameter) { systemParameterService.editMail(systemParameter); } @@ -79,7 +80,7 @@ public class SystemParameterController { } @PostMapping("/save/base") - @MsAuditLog(module = "system_parameter_setting", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getBaseLogDetails()", content = "#msClass.getBaseLogDetails()", msClass = SystemParameterService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_PARAMETER_SETTING, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getBaseLogDetails()", content = "#msClass.getBaseLogDetails()", msClass = SystemParameterService.class) public void saveBaseInfo(@RequestBody List systemParameter) { systemParameterService.saveBaseInfo(systemParameter); } @@ -90,7 +91,7 @@ public class SystemParameterController { } @PostMapping("/save/ldap") - @MsAuditLog(module = "system_parameter_setting", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails()", content = "#msClass.getLogDetails()", msClass = SystemParameterService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_PARAMETER_SETTING, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails()", content = "#msClass.getLogDetails()", msClass = SystemParameterService.class) public void saveLdap(@RequestBody List systemParameter) { systemParameterService.saveLdap(systemParameter); } @@ -101,7 +102,7 @@ public class SystemParameterController { } @PostMapping("save/header") - @MsAuditLog(module = "system_parameter_setting", type = OperLogConstants.UPDATE, title = "显示设置") + @MsAuditLog(module = OperLogModule.SYSTEM_PARAMETER_SETTING, type = OperLogConstants.UPDATE, title = "显示设置") public void saveHeader(@RequestBody UserHeader userHeader) { systemParameterService.saveHeader(userHeader); } diff --git a/backend/src/main/java/io/metersphere/controller/TestCaseTemplateController.java b/backend/src/main/java/io/metersphere/controller/TestCaseTemplateController.java index 698668890a..70ecaf2cb9 100644 --- a/backend/src/main/java/io/metersphere/controller/TestCaseTemplateController.java +++ b/backend/src/main/java/io/metersphere/controller/TestCaseTemplateController.java @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.TestCaseTemplate; import io.metersphere.base.domain.TestCaseTemplateWithBLOBs; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.BaseQueryRequest; @@ -26,7 +27,7 @@ public class TestCaseTemplateController { private TestCaseTemplateService testCaseTemplateService; @PostMapping("/add") - @MsAuditLog(module = "workspace_template_settings_case", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseTemplateService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_CASE, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseTemplateService.class) public void add(@RequestBody UpdateCaseFieldTemplateRequest request) { testCaseTemplateService.add(request); } @@ -38,13 +39,13 @@ public class TestCaseTemplateController { } @GetMapping("/delete/{id}") - @MsAuditLog(module = "workspace_template_settings_case", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestCaseTemplateService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_CASE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestCaseTemplateService.class) public void delete(@PathVariable(value = "id") String id) { testCaseTemplateService.delete(id); } @PostMapping("/update") - @MsAuditLog(module = "workspace_template_settings_case", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseTemplateService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS_CASE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseTemplateService.class) public void update(@RequestBody UpdateCaseFieldTemplateRequest request) { testCaseTemplateService.update(request); } diff --git a/backend/src/main/java/io/metersphere/controller/TestResourcePoolController.java b/backend/src/main/java/io/metersphere/controller/TestResourcePoolController.java index 4892f5ddd5..58b203de5d 100644 --- a/backend/src/main/java/io/metersphere/controller/TestResourcePoolController.java +++ b/backend/src/main/java/io/metersphere/controller/TestResourcePoolController.java @@ -3,6 +3,7 @@ package io.metersphere.controller; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.consul.CacheNode; @@ -25,28 +26,28 @@ public class TestResourcePoolController { private TestResourcePoolService testResourcePoolService; @PostMapping("/add") - @MsAuditLog(module = "system_test_resource", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#testResourcePoolDTO.id)", msClass = TestResourcePoolService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_TEST_RESOURCE, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#testResourcePoolDTO.id)", msClass = TestResourcePoolService.class) @CacheNode // 把监控节点缓存起来 public TestResourcePoolDTO addTestResourcePool(@RequestBody TestResourcePoolDTO testResourcePoolDTO) { return testResourcePoolService.addTestResourcePool(testResourcePoolDTO); } @GetMapping("/delete/{testResourcePoolId}") - @MsAuditLog(module = "system_test_resource", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testResourcePoolId)", msClass = TestResourcePoolService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_TEST_RESOURCE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testResourcePoolId)", msClass = TestResourcePoolService.class) @CacheNode // 把监控节点缓存起来 public void deleteTestResourcePool(@PathVariable(value = "testResourcePoolId") String testResourcePoolId) { testResourcePoolService.deleteTestResourcePool(testResourcePoolId); } @PostMapping("/update") - @MsAuditLog(module = "system_test_resource", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#testResourcePoolDTO.id)", content = "#msClass.getLogDetails(#testResourcePoolDTO.id)", msClass = TestResourcePoolService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_TEST_RESOURCE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#testResourcePoolDTO.id)", content = "#msClass.getLogDetails(#testResourcePoolDTO.id)", msClass = TestResourcePoolService.class) @CacheNode // 把监控节点缓存起来 public void updateTestResourcePool(@RequestBody TestResourcePoolDTO testResourcePoolDTO) { testResourcePoolService.updateTestResourcePool(testResourcePoolDTO); } @GetMapping("/update/{poolId}/{status}") - @MsAuditLog(module = "system_test_resource", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#poolId)", content = "#msClass.getLogDetails(#poolId)", msClass = TestResourcePoolService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_TEST_RESOURCE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#poolId)", content = "#msClass.getLogDetails(#poolId)", msClass = TestResourcePoolService.class) @CacheNode // 把监控节点缓存起来 public void updateTestResourcePoolStatus(@PathVariable String poolId, @PathVariable String status) { testResourcePoolService.updateTestResourcePoolStatus(poolId, status); diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index 5619127fe6..e3f4d707e2 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.User; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -37,7 +38,7 @@ public class UserController { private UserService userService; @PostMapping("/special/add") - @MsAuditLog(module = "system_user", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#user)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#user)", msClass = UserService.class) public UserDTO insertUser(@RequestBody UserRequest user) { return userService.insert(user); } @@ -54,7 +55,7 @@ public class UserController { } @GetMapping("/special/delete/{userId}") - @MsAuditLog(module = "system_user", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#userId)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#userId)", msClass = UserService.class) public void deleteUser(@PathVariable(value = "userId") String userId) { userService.deleteUser(userId); // 剔除在线用户 @@ -62,13 +63,13 @@ public class UserController { } @PostMapping("/special/update") - @MsAuditLog(module = "system_user", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#user)", content = "#msClass.getLogDetails(#user)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#user)", content = "#msClass.getLogDetails(#user)", msClass = UserService.class) public void updateUser(@RequestBody UserRequest user) { userService.updateUserRole(user); } @PostMapping("/special/update_status") - @MsAuditLog(module = "system_user", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#user.id)", content = "#msClass.getLogDetails(#user.id)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#user.id)", content = "#msClass.getLogDetails(#user.id)", msClass = UserService.class) public void updateStatus(@RequestBody User user) { userService.updateUser(user); } @@ -85,13 +86,13 @@ public class UserController { } @PostMapping("/special/ws/member/add") - @MsAuditLog(module = "workspace_member", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.userIds,#request.workspaceId)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_MEMBER, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.userIds,#request.workspaceId)", msClass = UserService.class) public void addMemberByAdmin(@RequestBody AddMemberRequest request) { userService.addMember(request); } @GetMapping("/special/ws/member/delete/{workspaceId}/{userId}") - @MsAuditLog(module = "workspace_member", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#userId)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_MEMBER, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#userId)", msClass = UserService.class) public void deleteMemberByAdmin(@PathVariable String workspaceId, @PathVariable String userId) { userService.deleteMember(workspaceId, userId); } @@ -102,7 +103,7 @@ public class UserController { } @PostMapping("/update/current") - @MsAuditLog(module = "personal_information_personal_settings", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#user.id)", content = "#msClass.getLogDetails(#user.id)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.PERSONAL_INFORMATION_PERSONAL_SETTINGS, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#user.id)", content = "#msClass.getLogDetails(#user.id)", msClass = UserService.class) public UserDTO updateCurrentUser(@RequestBody User user) { return userService.updateCurrentUser(user); } @@ -161,7 +162,7 @@ public class UserController { * 添加工作空间成员 */ @PostMapping("/ws/member/add") - @MsAuditLog(module = "workspace_member", type = OperLogConstants.CREATE, title = "添加工作空间成员") + @MsAuditLog(module = OperLogModule.WORKSPACE_MEMBER, type = OperLogConstants.CREATE, title = "添加工作空间成员") public void addMember(@RequestBody AddMemberRequest request) { String wsId = request.getWorkspaceId(); // workspaceService.checkWorkspaceOwner(wsId); @@ -179,7 +180,7 @@ public class UserController { * 删除工作空间成员 */ @GetMapping("/ws/member/delete/{workspaceId}/{userId}") - @MsAuditLog(module = "workspace_member", type = OperLogConstants.DELETE, title = "删除工作空间成员") + @MsAuditLog(module = OperLogModule.WORKSPACE_MEMBER, type = OperLogConstants.DELETE, title = "删除工作空间成员") public void deleteMember(@PathVariable String workspaceId, @PathVariable String userId) { // workspaceService.checkWorkspaceOwner(workspaceId); String currentUserId = SessionUtils.getUser().getId(); @@ -219,7 +220,7 @@ public class UserController { /*管理员修改用户密码*/ @PostMapping("/special/password") - @MsAuditLog(module = "system_user", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = UserService.class) public int updateUserPassword(@RequestBody EditPassWordRequest request) { return userService.updateUserPassword(request); } @@ -240,13 +241,13 @@ public class UserController { } @PostMapping("/import") - @MsAuditLog(module = "system_user", type = OperLogConstants.IMPORT) + @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.IMPORT) public ExcelResponse testCaseImport(MultipartFile file, HttpServletRequest request) { return userService.userImport(file, request); } @PostMapping("/special/batchProcessUserInfo") - @MsAuditLog(module = "system_user", type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.getLogDetails(#request)", content = "#msClass.getLogDetails(#request)", msClass = UserService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.getLogDetails(#request)", content = "#msClass.getLogDetails(#request)", msClass = UserService.class) public String batchProcessUserInfo(@RequestBody UserBatchProcessRequest request) { String returnString = "success"; userService.batchProcessUserInfo(request); diff --git a/backend/src/main/java/io/metersphere/controller/UserKeysController.java b/backend/src/main/java/io/metersphere/controller/UserKeysController.java index 0cb8dc662c..707927b8d9 100644 --- a/backend/src/main/java/io/metersphere/controller/UserKeysController.java +++ b/backend/src/main/java/io/metersphere/controller/UserKeysController.java @@ -2,6 +2,7 @@ package io.metersphere.controller; import io.metersphere.base.domain.UserKey; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.security.ApiKeyHandler; @@ -35,14 +36,14 @@ public class UserKeysController { } @GetMapping("generate") - @MsAuditLog(module = "personal_information_apikeys", type = OperLogConstants.CREATE, title = "API KEY") + @MsAuditLog(module = OperLogModule.PERSONAL_INFORMATION_APIKEYS, type = OperLogConstants.CREATE, title = "API KEY") public void generateUserKey() { String userId = SessionUtils.getUser().getId(); userKeyService.generateUserKey(userId); } @GetMapping("delete/{id}") - @MsAuditLog(module = "personal_information_apikeys", type = OperLogConstants.DELETE, title = "API KEY") + @MsAuditLog(module = OperLogModule.PERSONAL_INFORMATION_APIKEYS, type = OperLogConstants.DELETE, title = "API KEY") public void deleteUserKey(@PathVariable String id) { userKeyService.deleteUserKey(id); } @@ -53,7 +54,7 @@ public class UserKeysController { } @GetMapping("disable/{id}") - @MsAuditLog(module = "personal_information_apikeys", type = OperLogConstants.UPDATE, title = "API KEY") + @MsAuditLog(module = OperLogModule.PERSONAL_INFORMATION_APIKEYS, type = OperLogConstants.UPDATE, title = "API KEY") public void disabledUserKey(@PathVariable String id) { userKeyService.disableUserKey(id); } diff --git a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java index 6bbec83f91..ac59e1853f 100644 --- a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java +++ b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.Workspace; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.WorkspaceRequest; @@ -27,7 +28,7 @@ public class WorkspaceController { private UserService userService; @PostMapping("add") - @MsAuditLog(module = "system_workspace", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_WORKSPACE, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class) public Workspace addWorkspace(@RequestBody Workspace workspace) { return workspaceService.saveWorkspace(workspace); } @@ -38,33 +39,33 @@ public class WorkspaceController { } @PostMapping("special/add") - @MsAuditLog(module = "system_workspace", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_WORKSPACE, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class) public Workspace addWorkspaceByAdmin(@RequestBody Workspace workspace) { return workspaceService.addWorkspaceByAdmin(workspace); } @PostMapping("update") - @MsAuditLog(module = "system_workspace", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#workspace.id)", content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_WORKSPACE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#workspace.id)", content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class) public Workspace updateWorkspace(@RequestBody Workspace workspace) { // workspaceService.checkWorkspaceOwnerByOrgAdmin(workspace.getId()); return workspaceService.saveWorkspace(workspace); } @PostMapping("special/update") - @MsAuditLog(module = "system_workspace", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#workspace.id)", content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_WORKSPACE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#workspace.id)", content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class) public void updateWorkspaceByAdmin(@RequestBody Workspace workspace) { workspaceService.updateWorkspaceByAdmin(workspace); } @GetMapping("special/delete/{workspaceId}") - @MsAuditLog(module = "system_workspace", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#workspaceId)", msClass = WorkspaceService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_WORKSPACE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#workspaceId)", msClass = WorkspaceService.class) public void deleteWorkspaceByAdmin(@PathVariable String workspaceId) { userService.refreshSessionUser("workspace", workspaceId); workspaceService.deleteWorkspace(workspaceId); } @GetMapping("delete/{workspaceId}") - @MsAuditLog(module = "system_workspace", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#workspaceId)", msClass = WorkspaceService.class) + @MsAuditLog(module = OperLogModule.SYSTEM_WORKSPACE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#workspaceId)", msClass = WorkspaceService.class) public void deleteWorkspace(@PathVariable String workspaceId) { // workspaceService.checkWorkspaceOwnerByOrgAdmin(workspaceId); userService.refreshSessionUser("workspace", workspaceId); @@ -89,7 +90,7 @@ public class WorkspaceController { } @PostMapping("/member/update") - @MsAuditLog(module = "workspace_member", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = WorkspaceService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_MEMBER, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = WorkspaceService.class) public void updateOrgMember(@RequestBody WorkspaceMemberDTO memberDTO) { workspaceService.updateWorkspaceMember(memberDTO); } diff --git a/backend/src/main/java/io/metersphere/controller/WorkstationController.java b/backend/src/main/java/io/metersphere/controller/WorkstationController.java index 65931276e0..2ce44f7b82 100644 --- a/backend/src/main/java/io/metersphere/controller/WorkstationController.java +++ b/backend/src/main/java/io/metersphere/controller/WorkstationController.java @@ -1,18 +1,9 @@ package io.metersphere.controller; -import com.github.pagehelper.Page; -import com.github.pagehelper.PageHelper; -import io.metersphere.api.dto.automation.ApiScenarioRequest; -import io.metersphere.base.domain.IssueTemplate; -import io.metersphere.commons.utils.PageUtils; -import io.metersphere.commons.utils.Pager; -import io.metersphere.controller.request.BaseQueryRequest; -import io.metersphere.service.WorkspaceService; import io.metersphere.service.WorkstationService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.List; import java.util.Map; @RequestMapping("workstation") @@ -23,8 +14,7 @@ public class WorkstationController { private WorkstationService workstationService; @PostMapping("/creat_case_count/list") - public Map list() { - - return workstationService.getMyCreatedCaseGroupContMap(); + public Map list() { + return workstationService.getMyCreatedCaseGroupContMap(); } } diff --git a/backend/src/main/java/io/metersphere/ldap/controller/LdapController.java b/backend/src/main/java/io/metersphere/ldap/controller/LdapController.java index 3a87affb65..315a9b5288 100644 --- a/backend/src/main/java/io/metersphere/ldap/controller/LdapController.java +++ b/backend/src/main/java/io/metersphere/ldap/controller/LdapController.java @@ -1,6 +1,7 @@ package io.metersphere.ldap.controller; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.controller.ResultHolder; import io.metersphere.controller.request.LoginRequest; import io.metersphere.ldap.service.LdapService; @@ -16,7 +17,7 @@ public class LdapController { private LdapService ldapService; @PostMapping(value = "/signin") - @MsAuditLog(module = "system_parameter_setting", type = OperLogConstants.LOGIN, title = "LDAP") + @MsAuditLog(module = OperLogModule.SYSTEM_PARAMETER_SETTING, type = OperLogConstants.LOGIN, title = "LDAP") public ResultHolder login(@RequestBody LoginRequest request) { return ldapService.login(request); } @@ -27,7 +28,7 @@ public class LdapController { } @PostMapping("/test/login") - @MsAuditLog(module = "system_parameter_setting", type = OperLogConstants.LOGIN, title = "LDAP") + @MsAuditLog(module = OperLogModule.SYSTEM_PARAMETER_SETTING, type = OperLogConstants.LOGIN, title = "LDAP") public void testLogin(@RequestBody LoginRequest request) { ldapService.authenticate(request); } diff --git a/backend/src/main/java/io/metersphere/log/aspect/MsLogAspect.java b/backend/src/main/java/io/metersphere/log/aspect/MsLogAspect.java index 96b45012bc..57810e7882 100644 --- a/backend/src/main/java/io/metersphere/log/aspect/MsLogAspect.java +++ b/backend/src/main/java/io/metersphere/log/aspect/MsLogAspect.java @@ -137,7 +137,7 @@ public class MsLogAspect { // 项目ID msOperLog.setProjectId(msLog.project()); - String module = Translator.get(msLog.module()); + String module = msLog.module(); msOperLog.setOperModule(StringUtils.isNotEmpty(module) ? module : msLog.module()); //获取方法参数名 String[] params = discoverer.getParameterNames(method); diff --git a/backend/src/main/java/io/metersphere/track/controller/IssueCommentController.java b/backend/src/main/java/io/metersphere/track/controller/IssueCommentController.java index a9fe5c6d0e..f873671712 100644 --- a/backend/src/main/java/io/metersphere/track/controller/IssueCommentController.java +++ b/backend/src/main/java/io/metersphere/track/controller/IssueCommentController.java @@ -3,6 +3,7 @@ package io.metersphere.track.controller; import io.metersphere.base.domain.IssueComment; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.notice.annotation.SendNotice; @@ -42,14 +43,14 @@ public class IssueCommentController { @GetMapping("/delete/{commentId}") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) - @MsAuditLog(module = "track_bug", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#commentId)", msClass = TestCaseCommentService.class) + @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#commentId)", msClass = TestCaseCommentService.class) public void deleteComment(@PathVariable String commentId) { issueCommentService.delete(commentId); } @PostMapping("/edit") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) - @MsAuditLog(module = "track_bug", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseCommentService.class) + @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseCommentService.class) public IssueComment editComment(@RequestBody SaveIssueCommentRequest request) { return issueCommentService.edit(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/IssuesController.java b/backend/src/main/java/io/metersphere/track/controller/IssuesController.java index e0c17dc26e..dc6fea14f0 100644 --- a/backend/src/main/java/io/metersphere/track/controller/IssuesController.java +++ b/backend/src/main/java/io/metersphere/track/controller/IssuesController.java @@ -7,6 +7,7 @@ import io.metersphere.base.domain.IssuesDao; import io.metersphere.base.domain.IssuesWithBLOBs; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -50,7 +51,7 @@ public class IssuesController { @PostMapping("/add") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ_CREATE) - @MsAuditLog(module = "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", event = NoticeConstants.Event.CREATE, mailTemplate = "track/IssuesCreate", subject = "缺陷通知") public IssuesWithBLOBs addIssues(@RequestBody IssuesUpdateRequest issuesRequest) { @@ -59,7 +60,7 @@ public class IssuesController { @PostMapping("/update") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ_EDIT) - @MsAuditLog(module = "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", event = NoticeConstants.Event.UPDATE, mailTemplate = "track/IssuesUpdate", subject = "缺陷通知") public void updateIssues(@RequestBody IssuesUpdateRequest issuesRequest) { @@ -101,7 +102,7 @@ public class IssuesController { @PostMapping("/delete") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ_DELETE) - @MsAuditLog(module = "track_bug", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = IssuesService.class) + @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = IssuesService.class) public void deleteIssue(@RequestBody IssuesRequest request) { issuesService.deleteIssue(request); } @@ -112,7 +113,7 @@ public class IssuesController { } @GetMapping("/delete/{id}") - @MsAuditLog(module = "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 = "缺陷通知") public void delete(@PathVariable String id) { issuesService.delete(id); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseCommentController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseCommentController.java index 9ff582fbf8..dbb9f63616 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseCommentController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseCommentController.java @@ -3,6 +3,7 @@ package io.metersphere.track.controller; import io.metersphere.base.domain.TestCaseComment; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.notice.annotation.SendNotice; @@ -26,7 +27,7 @@ public class TestCaseCommentController { @PostMapping("/save") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) - @MsAuditLog(module = "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, event = NoticeConstants.Event.COMMENT, mailTemplate = "track/TestCaseComment", subject = "测试用例通知") public TestCaseComment saveComment(@RequestBody SaveCommentRequest request) { @@ -41,16 +42,14 @@ public class TestCaseCommentController { @GetMapping("/delete/{commentId}") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#commentId)", msClass = TestCaseCommentService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#commentId)", msClass = TestCaseCommentService.class) public void deleteComment(@PathVariable String commentId) { testCaseCommentService.delete(commentId); } @PostMapping("/edit") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseCommentService.class) -// @SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.getTestCase(#request.caseId)", targetClass = TestCaseService.class, -// event = NoticeConstants.Event.COMMENT, mailTemplate = "track/TestCaseComment", subject = "测试用例通知") + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseCommentService.class) public TestCaseComment editComment(@RequestBody SaveCommentRequest request) { return testCaseCommentService.edit(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java index 4ac5fa54a1..935ce5becd 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java @@ -13,6 +13,7 @@ import io.metersphere.base.domain.TestCaseWithBLOBs; import io.metersphere.base.mapper.TestCaseMapper; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -193,7 +194,7 @@ public class TestCaseController { @PostMapping(value = "/add", consumes = {"multipart/form-data"}) @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_CREATE) - @MsAuditLog(module = "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, event = NoticeConstants.Event.CREATE, mailTemplate = "track/TestCaseCreate", subject = "测试用例通知") public TestCase addTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { @@ -213,7 +214,7 @@ public class TestCaseController { } @PostMapping(value = "/edit", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "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, event = NoticeConstants.Event.UPDATE, mailTemplate = "track/TestCaseUpdate", subject = "测试用例通知") public TestCase editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { @@ -221,20 +222,20 @@ public class TestCaseController { } @PostMapping(value = "/edit/testPlan", consumes = {"multipart/form-data"}) - @MsAuditLog(module = "track_test_case", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogBeforeDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogBeforeDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseService.class) public String editTestCaseByTestPlan(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { return testCaseService.editTestCase(request, files); } @PostMapping("/delete/{testCaseId}") - @MsAuditLog(module = "track_test_case", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testCaseId)", msClass = TestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testCaseId)", msClass = TestCaseService.class) public int deleteTestCase(@PathVariable String testCaseId) { checkPermissionService.checkTestCaseOwner(testCaseId); return testCaseService.deleteTestCaseBySameVersion(testCaseId); } @PostMapping("/deleteToGc/{testCaseId}") - @MsAuditLog(module = "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, mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") public int deleteToGC(@PathVariable String testCaseId) { @@ -243,7 +244,7 @@ public class TestCaseController { } @GetMapping("/deletePublic/{versionId}/{refId}") - @MsAuditLog(module = "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, mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") public void deletePublic(@PathVariable String versionId, @PathVariable String refId) { @@ -252,7 +253,7 @@ public class TestCaseController { @PostMapping("/import") - @MsAuditLog(module = "track_test_case", type = OperLogConstants.IMPORT, project = "#projectId") + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.IMPORT, project = "#projectId") public ExcelResponse testCaseImport(@RequestPart("request") TestCaseImportRequest request, @RequestPart("file") MultipartFile file, HttpServletRequest httpRequest) { checkPermissionService.checkProjectOwner(request.getProjectId()); return testCaseService.testCaseImport(file, request, httpRequest); @@ -272,21 +273,21 @@ public class TestCaseController { @PostMapping("/export/testcase") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EXPORT) - @MsAuditLog(module = "track_test_case", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public void testCaseExport(HttpServletResponse response, @RequestBody TestCaseBatchRequest request) { testCaseService.testCaseExport(response, request); } @PostMapping("/export/testcase/xmind") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EXPORT) - @MsAuditLog(module = "track_test_case", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public void testCaseXmindExport(HttpServletResponse response, @RequestBody TestCaseBatchRequest request) { testCaseService.testCaseXmindExport(response, request); } @PostMapping("/batch/edit") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT) - @MsAuditLog(module = "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, event = NoticeConstants.Event.UPDATE, mailTemplate = "track/TestCaseUpdate", subject = "测试用例通知") public void editTestCaseBath(@RequestBody TestCaseBatchRequest request) { @@ -299,14 +300,14 @@ public class TestCaseController { @PostMapping("/batch/copy") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_COPY) - @MsAuditLog(module = "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) public void copyTestCaseBath(@RequestBody TestCaseBatchRequest request) { testCaseService.copyTestCaseBath(request); } @PostMapping("/batch/copy/public") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT) - @MsAuditLog(module = "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, event = NoticeConstants.Event.CREATE, mailTemplate = "track/TestCaseUpdate", subject = "测试用例通知") public void copyTestCaseBathPublic(@RequestBody TestCaseBatchRequest request) { @@ -316,14 +317,14 @@ public class TestCaseController { @PostMapping("/batch/delete") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_DELETE) - @MsAuditLog(module = "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) public void deleteTestCaseBath(@RequestBody TestCaseBatchRequest request) { testCaseService.deleteTestCaseBath(request); } @PostMapping("/batch/deleteToGc") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_DELETE) - @MsAuditLog(module = "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, event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") public void deleteToGcBatch(@RequestBody TestCaseBatchRequest request) { @@ -332,7 +333,7 @@ public class TestCaseController { @PostMapping("/batch/movePublic/deleteToGc") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_DELETE) - @MsAuditLog(module = "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, event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestCaseDelete", subject = "测试用例通知") public void deleteToGcBatchPublic(@RequestBody List ids) { @@ -340,7 +341,7 @@ public class TestCaseController { } @PostMapping("/reduction") - @MsAuditLog(module = "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) public void reduction(@RequestBody TestCaseBatchRequest request) { testCaseService.reduction(request); } @@ -370,7 +371,7 @@ public class TestCaseController { } @PostMapping("/save") - @MsAuditLog(module = "track_test_case", type = OperLogConstants.CREATE, title = "#testCaseWithBLOBs.name", content = "#msClass.getLogDetails(#testCaseWithBLOBs.id)", msClass = TestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.CREATE, title = "#testCaseWithBLOBs.name", content = "#msClass.getLogDetails(#testCaseWithBLOBs.id)", msClass = TestCaseService.class) public TestCaseWithBLOBs saveTestCase(@RequestBody EditTestCaseRequest request) { request.setId(UUID.randomUUID().toString()); return testCaseService.addTestCase(request); @@ -378,7 +379,7 @@ public class TestCaseController { @PostMapping("/minder/edit") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT) - @MsAuditLog(module = "track_test_case", type = OperLogConstants.BATCH_UPDATE, project = "#request.projectId", beforeEvent = "#msClass.getCaseLogDetails(#request)", content = "#msClass.getCaseLogDetails(#request)", msClass = TestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.BATCH_UPDATE, project = "#request.projectId", beforeEvent = "#msClass.getCaseLogDetails(#request)", content = "#msClass.getCaseLogDetails(#request)", msClass = TestCaseService.class) public void minderEdit(@RequestBody TestCaseMinderEditRequest request) { testCaseService.minderEdit(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseIssuesController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseIssuesController.java index d0a8237fae..aead779d3a 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseIssuesController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseIssuesController.java @@ -1,6 +1,7 @@ package io.metersphere.track.controller; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.track.dto.TestCaseDTO; import io.metersphere.track.request.issues.IssuesRelevanceRequest; @@ -26,7 +27,7 @@ public class TestCaseIssuesController { } @PostMapping("/relate") - @MsAuditLog(module = "track_test_case", type = OperLogConstants.ASSOCIATE_ISSUE, content = "#msClass.getLogDetails(#request)", msClass = TestCaseIssueService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.ASSOCIATE_ISSUE, content = "#msClass.getLogDetails(#request)", msClass = TestCaseIssueService.class) public void relate(@RequestBody IssuesRelevanceRequest request) { testCaseIssueService.relate(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseNodeController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseNodeController.java index 05edaa788e..670087627b 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseNodeController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseNodeController.java @@ -2,6 +2,7 @@ package io.metersphere.track.controller; import io.metersphere.base.domain.TestCaseNode; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.service.CheckPermissionService; import io.metersphere.track.dto.TestCaseNodeDTO; @@ -79,26 +80,26 @@ public class TestCaseNodeController { } @PostMapping("/add") - @MsAuditLog(module = "track_test_case", type = OperLogConstants.CREATE, title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = TestCaseNodeService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.CREATE, title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = TestCaseNodeService.class) public String addNode(@RequestBody TestCaseNode node) { return testCaseNodeService.addNode(node); } @PostMapping("/edit") - @MsAuditLog(module = "track_test_case", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = TestCaseNodeService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = TestCaseNodeService.class) public int editNode(@RequestBody DragNodeRequest node) { return testCaseNodeService.editNode(node); } @PostMapping("/delete") - @MsAuditLog(module = "track_test_case", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#nodeIds)", msClass = TestCaseNodeService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#nodeIds)", msClass = TestCaseNodeService.class) public int deleteNode(@RequestBody List nodeIds) { //nodeIds 包含删除节点ID及其所有子节点ID return testCaseNodeService.deleteNode(nodeIds); } @PostMapping("/drag") - @MsAuditLog(module = "track_test_case", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = TestCaseNodeService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#node)", title = "#node.name", content = "#msClass.getLogDetails(#node)", msClass = TestCaseNodeService.class) public void dragNode(@RequestBody DragNodeRequest node) { testCaseNodeService.dragNode(node); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseReportController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseReportController.java index 01db638da6..905007491d 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseReportController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseReportController.java @@ -2,6 +2,7 @@ package io.metersphere.track.controller; import io.metersphere.base.domain.TestCaseReport; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.track.request.testCaseReport.CreateReportRequest; import io.metersphere.track.service.TestCaseReportService; @@ -29,20 +30,20 @@ public class TestCaseReportController { } @PostMapping("/add") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseReportService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseReportService.class) public String addByTemplateId(@RequestBody CreateReportRequest request) { request.setId(UUID.randomUUID().toString()); return testCaseReportService.addTestCaseReportByTemplateId(request); } @PostMapping("/edit") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#TestCaseReport.id)", content = "#msClass.getLogDetails(#TestCaseReport.id)", msClass = TestCaseReportService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#TestCaseReport.id)", content = "#msClass.getLogDetails(#TestCaseReport.id)", msClass = TestCaseReportService.class) public void edit(@RequestBody TestCaseReport TestCaseReport) { testCaseReportService.editTestCaseReport(TestCaseReport); } @PostMapping("/delete/{id}") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestCaseReportService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestCaseReportService.class) public int delete(@PathVariable String id) { return testCaseReportService.deleteTestCaseReport(id); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseReportTemplateController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseReportTemplateController.java index 5b6669374e..e166687574 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseReportTemplateController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseReportTemplateController.java @@ -2,6 +2,7 @@ package io.metersphere.track.controller; import io.metersphere.base.domain.TestCaseReportTemplate; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.track.request.testCaseReport.QueryTemplateRequest; import io.metersphere.track.service.TestCaseReportTemplateService; @@ -28,19 +29,19 @@ public class TestCaseReportTemplateController { } @PostMapping("/add") - @MsAuditLog(module = "workspace_template_settings", type = OperLogConstants.CREATE, title = "#testCaseReportTemplate.name",sourceId = "#testCaseReportTemplate.id") + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS, type = OperLogConstants.CREATE, title = "#testCaseReportTemplate.name",sourceId = "#testCaseReportTemplate.id") public void add(@RequestBody TestCaseReportTemplate testCaseReportTemplate) { testCaseReportTemplateService.addTestCaseReportTemplate(testCaseReportTemplate); } @PostMapping("/edit") - @MsAuditLog(module = "workspace_template_settings", type = OperLogConstants.UPDATE, title = "#testCaseReportTemplate.name",sourceId = "#testCaseReportTemplate.id") + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS, type = OperLogConstants.UPDATE, title = "#testCaseReportTemplate.name",sourceId = "#testCaseReportTemplate.id") public void edit(@RequestBody TestCaseReportTemplate testCaseReportTemplate) { testCaseReportTemplateService.editTestCaseReportTemplate(testCaseReportTemplate); } @PostMapping("/delete/{id}") - @MsAuditLog(module = "workspace_template_settings", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestCaseReportTemplateService.class) + @MsAuditLog(module = OperLogModule.WORKSPACE_TEMPLATE_SETTINGS, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestCaseReportTemplateService.class) public int delete(@PathVariable String id) { return testCaseReportTemplateService.deleteTestCaseReportTemplate(id); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseReviewController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseReviewController.java index 0709940b57..d796d40eed 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseReviewController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseReviewController.java @@ -8,6 +8,7 @@ import io.metersphere.base.domain.TestCaseReview; import io.metersphere.base.domain.User; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -52,7 +53,7 @@ public class TestCaseReviewController { @PostMapping("/save") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_CREATE) - @MsAuditLog(module = "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 = "测试评审通知") public TestCaseReview saveCaseReview(@RequestBody SaveTestCaseReviewRequest reviewRequest) { reviewRequest.setId(UUID.randomUUID().toString()); @@ -84,7 +85,7 @@ public class TestCaseReviewController { @PostMapping("/edit") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_EDIT) - @MsAuditLog(module = "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 = "测试评审通知") public TestCaseReview editCaseReview(@RequestBody SaveTestCaseReviewRequest testCaseReview) { return testCaseReviewService.editCaseReview(testCaseReview); @@ -92,7 +93,7 @@ public class TestCaseReviewController { @GetMapping("/delete/{reviewId}") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_DELETE) - @MsAuditLog(module = "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, event = NoticeConstants.Event.DELETE, mailTemplate = "track/ReviewDelete", subject = "测试评审通知") public void deleteCaseReview(@PathVariable String reviewId) { @@ -107,7 +108,7 @@ public class TestCaseReviewController { } @PostMapping("/relevance") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request)", msClass = TestCaseReviewService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request)", msClass = TestCaseReviewService.class) public void testReviewRelevance(@RequestBody ReviewRelevanceRequest request) { testCaseReviewService.testReviewRelevance(request); } @@ -155,7 +156,7 @@ public class TestCaseReviewController { @PostMapping("/comment/save") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ_COMMENT) - @MsAuditLog(module = "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.getTestCase(#request.caseId)", targetClass = TestCaseService.class, event = NoticeConstants.Event.COMMENT, mailTemplate = "track/TestCaseComment", subject = "测试评审通知") public TestCaseComment saveComment(@RequestBody SaveCommentRequest request) { diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanApiCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanApiCaseController.java index fd2c5f1255..ef1d9477c7 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanApiCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanApiCaseController.java @@ -8,6 +8,7 @@ import io.metersphere.api.dto.definition.ApiTestCaseRequest; import io.metersphere.api.dto.definition.BatchRunDefinitionRequest; import io.metersphere.api.dto.definition.TestPlanApiCaseDTO; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -63,27 +64,27 @@ public class TestPlanApiCaseController { @GetMapping("/delete/{id}") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_RELEVANCE_OR_CANCEL) - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanApiCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanApiCaseService.class) public int deleteTestCase(@PathVariable String id) { return testPlanApiCaseService.delete(id); } @PostMapping("/batch/delete") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_RELEVANCE_OR_CANCEL) - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanApiCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanApiCaseService.class) public void deleteApiCaseBath(@RequestBody TestPlanApiCaseBatchRequest request) { testPlanApiCaseService.deleteApiCaseBath(request); } @PostMapping("/batch/update/env") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_RELEVANCE_OR_CANCEL) - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanApiCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanApiCaseService.class) public void batchUpdateEnv(@RequestBody TestPlanApiCaseBatchRequest request) { testPlanApiCaseService.batchUpdateEnv(request); } @PostMapping(value = "/run") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.planIds)", msClass = TestPlanApiCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.planIds)", msClass = TestPlanApiCaseService.class) public List run(@RequestBody BatchRunDefinitionRequest request) { return testPlanApiCaseService.run(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java index 9ec6666184..37d6134d31 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java @@ -9,6 +9,7 @@ import io.metersphere.api.service.ApiAutomationService; import io.metersphere.base.domain.*; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -96,7 +97,7 @@ public class TestPlanController { @PostMapping("/add") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_CREATE) - @MsAuditLog(module = "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 = "测试计划通知") public TestPlan addTestPlan(@RequestBody AddTestPlanRequest testPlan) { testPlan.setId(UUID.randomUUID().toString()); @@ -105,7 +106,7 @@ public class TestPlanController { @PostMapping("/edit") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_EDIT) - @MsAuditLog(module = "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 = "测试计划通知") public TestPlan editTestPlan(@RequestBody AddTestPlanRequest testPlanDTO) { return testPlanService.editTestPlanWithRequest(testPlanDTO); @@ -113,7 +114,7 @@ public class TestPlanController { @PostMapping("/edit/status/{planId}") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_EDIT) - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#planId)", content = "#msClass.getLogDetails(#planId)", msClass = TestPlanService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#planId)", content = "#msClass.getLogDetails(#planId)", msClass = TestPlanService.class) public void editTestPlanStatus(@PathVariable String planId) { checkPermissionService.checkTestPlanOwner(planId); testPlanService.editTestPlanStatus(planId); @@ -134,7 +135,7 @@ public class TestPlanController { @PostMapping("/delete/{testPlanId}") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_DELETE) - @MsAuditLog(module = "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, event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestPlanDelete", subject = "测试计划通知") public int deleteTestPlan(@PathVariable String testPlanId) { @@ -143,7 +144,7 @@ public class TestPlanController { } @PostMapping("/relevance") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request)", msClass = TestPlanService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request)", msClass = TestPlanService.class) public void testPlanRelevance(@RequestBody PlanCaseRelevanceRequest request) { testPlanService.testPlanRelevance(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanLoadCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanLoadCaseController.java index 1b76f151f2..927fb440e3 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanLoadCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanLoadCaseController.java @@ -6,6 +6,7 @@ import io.metersphere.base.domain.LoadTest; import io.metersphere.base.domain.TestPlanLoadCase; import io.metersphere.base.domain.TestPlanLoadCaseWithBLOBs; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.TriggerMode; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -37,7 +38,7 @@ public class TestPlanLoadCaseController { } @PostMapping("/relevance") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request.caseIds,#request.testPlanId)", msClass = TestPlanLoadCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#request.caseIds,#request.testPlanId)", msClass = TestPlanLoadCaseService.class) public void relevanceCase(@RequestBody LoadCaseRequest request) { testPlanLoadCaseService.relevanceCase(request); } @@ -54,19 +55,19 @@ public class TestPlanLoadCaseController { } @GetMapping("/delete/{id}") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanLoadCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanLoadCaseService.class) public void delete(@PathVariable String id) { testPlanLoadCaseService.delete(id); } @PostMapping("/run") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.testPlanLoadId)", msClass = TestPlanLoadCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.testPlanLoadId)", msClass = TestPlanLoadCaseService.class) public String run(@RequestBody RunTestPlanRequest request) { return testPlanLoadCaseService.run(request); } @PostMapping("/run/batch") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.EXECUTE, content = "#msClass.getRunLogDetails(#request.requests)", msClass = TestPlanLoadCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.EXECUTE, content = "#msClass.getRunLogDetails(#request.requests)", msClass = TestPlanLoadCaseService.class) public void runBatch(@RequestBody RunBatchTestPlanRequest request) { if (request.getRequests() != null) { for (RunTestPlanRequest req : request.getRequests()) { @@ -82,19 +83,19 @@ public class TestPlanLoadCaseController { } @PostMapping("/batch/delete") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanLoadCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanLoadCaseService.class) public void batchDelete(@RequestBody LoadCaseReportBatchRequest request) { testPlanLoadCaseService.batchDelete(request); } @PostMapping("/update") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UPDATE, content = "#msClass.getLogDetails(#testPlanLoadCase.id)", msClass = TestPlanLoadCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UPDATE, content = "#msClass.getLogDetails(#testPlanLoadCase.id)", msClass = TestPlanLoadCaseService.class) public void update(@RequestBody TestPlanLoadCaseWithBLOBs testPlanLoadCase) { testPlanLoadCaseService.update(testPlanLoadCase); } @PostMapping("/update/api") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UPDATE, content = "#msClass.getLogDetails(#testPlanLoadCase.id)", msClass = TestPlanLoadCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UPDATE, content = "#msClass.getLogDetails(#testPlanLoadCase.id)", msClass = TestPlanLoadCaseService.class) public void updateByApi(@RequestBody TestPlanLoadCase testPlanLoadCase) { testPlanLoadCaseService.updateByApi(testPlanLoadCase); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java index f446743e5e..bc355d0f56 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.TestPlanReport; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.ReportTriggerMode; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; @@ -66,7 +67,7 @@ public class TestPlanReportController { } @PostMapping("/delete") - @MsAuditLog(module = "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, event = NoticeConstants.Event.DELETE, mailTemplate = "track/ReportDelete", subject = "报告通知") public void delete(@RequestBody List testPlanReportIdList) { diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanScenarioCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanScenarioCaseController.java index 80f1e756d6..21b19fd7b5 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanScenarioCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanScenarioCaseController.java @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; import io.metersphere.api.dto.automation.*; import io.metersphere.commons.constants.ApiRunMode; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.constants.RunModeConstants; @@ -61,19 +62,19 @@ public class TestPlanScenarioCaseController { } @GetMapping("/delete/{id}") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanScenarioCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanScenarioCaseService.class) public int deleteTestCase(@PathVariable String id) { return testPlanScenarioCaseService.delete(id); } @PostMapping("/batch/delete") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanScenarioCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanScenarioCaseService.class) public void deleteApiCaseBath(@RequestBody TestPlanScenarioCaseBatchRequest request) { testPlanScenarioCaseService.deleteApiCaseBath(request); } @PostMapping(value = "/run") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.planCaseIds)", msClass = TestPlanScenarioCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.planCaseIds)", msClass = TestPlanScenarioCaseService.class) public List run(@RequestBody RunTestPlanScenarioRequest request) { request.setExecuteType(ExecuteType.Completed.name()); if(request.getConfig() == null){ @@ -86,7 +87,7 @@ public class TestPlanScenarioCaseController { } @PostMapping(value = "/jenkins/run") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanScenarioCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanScenarioCaseService.class) public List runByRun(@RequestBody RunTestPlanScenarioRequest request) { request.setExecuteType(ExecuteType.Saved.name()); request.setTriggerMode(ApiRunMode.API.name()); @@ -95,7 +96,7 @@ public class TestPlanScenarioCaseController { } @PostMapping("/batch/update/env") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanScenarioCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanScenarioCaseService.class) public void batchUpdateEnv(@RequestBody RelevanceScenarioRequest request) { testPlanScenarioCaseService.batchUpdateEnv(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java index 89dfb0839c..003de8c8c5 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.TestPlanTestCaseWithBLOBs; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.ResetOrderRequest; @@ -96,31 +97,31 @@ public class TestPlanTestCaseController { } @PostMapping("/edit") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.UPDATE, content = "#msClass.getLogDetails(#testPlanTestCase.id)", msClass = TestPlanTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UPDATE, content = "#msClass.getLogDetails(#testPlanTestCase.id)", msClass = TestPlanTestCaseService.class) public void editTestCase(@RequestBody TestPlanTestCaseWithBLOBs testPlanTestCase) { testPlanTestCaseService.editTestCase(testPlanTestCase); } @PostMapping("/minder/edit") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getCaseLogDetails(#testPlanTestCases)", msClass = TestPlanTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getCaseLogDetails(#testPlanTestCases)", msClass = TestPlanTestCaseService.class) public void editTestCaseForMinder(@RequestBody List testPlanTestCases) { testPlanTestCaseService.editTestCaseForMinder(testPlanTestCases); } @PostMapping("/batch/edit") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanTestCaseService.class) public void editTestCaseBath(@RequestBody TestPlanCaseBatchRequest request) { testPlanTestCaseService.editTestCaseBath(request); } @PostMapping("/batch/delete") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanTestCaseService.class) public void deleteTestCaseBath(@RequestBody TestPlanCaseBatchRequest request) { testPlanTestCaseService.deleteTestCaseBath(request); } @PostMapping("/delete/{id}") - @MsAuditLog(module = "track_test_plan", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanTestCaseService.class) public int deleteTestCase(@PathVariable String id) { return testPlanTestCaseService.deleteTestCase(id); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java index da5de7daa6..6f6c1fcefc 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.TestCaseReviewTestCase; import io.metersphere.commons.constants.OperLogConstants; +import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.ResetOrderRequest; @@ -32,25 +33,25 @@ public class TestReviewTestCaseController { } @PostMapping("/delete") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request)", msClass = TestReviewTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request)", msClass = TestReviewTestCaseService.class) public int deleteTestCase(@RequestBody DeleteRelevanceRequest request) { return testReviewTestCaseService.deleteTestCase(request); } @PostMapping("/batch/delete") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request)", msClass = TestReviewTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request)", msClass = TestReviewTestCaseService.class) public void deleteTestCaseBatch(@RequestBody TestReviewCaseBatchRequest request) { testReviewTestCaseService.deleteTestCaseBatch(request); } @PostMapping("/batch/edit/status") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request)", content = "#msClass.getLogDetails(#request)", msClass = TestReviewTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request)", content = "#msClass.getLogDetails(#request)", msClass = TestReviewTestCaseService.class) public void editTestCaseBatch(@RequestBody TestReviewCaseBatchRequest request) { testReviewTestCaseService.editTestCaseBatchStatus(request); } @PostMapping("/minder/edit/{reviewId}") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#testCases)", msClass = TestReviewTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.ASSOCIATE_CASE, content = "#msClass.getLogDetails(#testCases)", msClass = TestReviewTestCaseService.class) public void editTestCaseForMinder(@PathVariable("reviewId") String reviewId, @RequestBody List testCases) { testReviewTestCaseService.editTestCaseForMinder(reviewId, testCases); } @@ -61,7 +62,7 @@ public class TestReviewTestCaseController { } @PostMapping("/edit") - @MsAuditLog(module = "track_test_case_review", type = OperLogConstants.REVIEW, content = "#msClass.getLogDetails(#testCaseReviewTestCase)", msClass = TestReviewTestCaseService.class) + @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.REVIEW, content = "#msClass.getLogDetails(#testCaseReviewTestCase)", msClass = TestReviewTestCaseService.class) public void editTestCase(@RequestBody TestCaseReviewTestCase testCaseReviewTestCase) { testReviewTestCaseService.editTestCase(testCaseReviewTestCase); } diff --git a/frontend/src/business/components/project/menu/Log.vue b/frontend/src/business/components/project/menu/Log.vue index 995d41cb3d..d1c47fdbc8 100644 --- a/frontend/src/business/components/project/menu/Log.vue +++ b/frontend/src/business/components/project/menu/Log.vue @@ -98,7 +98,11 @@ {{ getType(scope.row.operType) }} - + + + - + + +