diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java index ca38a3abe8..26f3e8148a 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java @@ -62,7 +62,7 @@ public class TestPlanReportController { @Operation(summary = "测试计划-报告-重命名") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ_UPDATE) @CheckOwner(resourceId = "#id", resourceType = "test_plan_report") - @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#id)", msClass = TestPlanReportLogService.class) + @Log(type = OperationLogType.UPDATE, expression = "#msClass.renameLog(#id, #name)", msClass = TestPlanReportLogService.class) public void rename(@PathVariable String id, @RequestBody Object name) { testPlanReportService.rename(id, name.toString()); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportLogService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportLogService.java index 7f487008ad..11cf4fe48c 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportLogService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportLogService.java @@ -68,6 +68,24 @@ public class TestPlanReportLogService { return dto; } + public LogDTO renameLog(String id, Object name) { + TestPlanReport report = testPlanReportMapper.selectByPrimaryKey(id); + Project project = projectMapper.selectByPrimaryKey(report.getProjectId()); + LogDTO dto = new LogDTO( + report.getProjectId(), + project.getOrganizationId(), + report.getId(), + null, + OperationLogType.UPDATE.name(), + OperationLogModule.TEST_PLAN_REPORT, + name.toString()); + + dto.setPath(OperationLogAspect.getPath()); + dto.setMethod(HttpMethodConstants.GET.name()); + dto.setOriginalValue(JSON.toJSONBytes(report)); + return dto; + } + public LogDTO updateDetailLog(TestPlanReportDetailEditRequest request) { return updateLog(request.getId()); }