diff --git a/performance-test/backend/src/main/java/io/metersphere/controller/PerformanceTestController.java b/performance-test/backend/src/main/java/io/metersphere/controller/PerformanceTestController.java index bb2072607f..e6662cdb8d 100644 --- a/performance-test/backend/src/main/java/io/metersphere/controller/PerformanceTestController.java +++ b/performance-test/backend/src/main/java/io/metersphere/controller/PerformanceTestController.java @@ -182,7 +182,7 @@ public class PerformanceTestController { } @PostMapping("/run") - @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST, type = OperLogConstants.EXECUTE, content = "#msClass.getLogDetails(#request.id)", msClass = PerformanceTestService.class) + @MsAuditLog(module = OperLogModule.PERFORMANCE_TEST, type = OperLogConstants.EXECUTE, beforeEvent = "#msClass.getRunLogDetails(#request.id)", msClass = PerformanceTestService.class) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_RUN) public String run(@RequestBody RunTestPlanRequest request) { return performanceTestService.run(request); diff --git a/performance-test/backend/src/main/java/io/metersphere/service/PerformanceTestService.java b/performance-test/backend/src/main/java/io/metersphere/service/PerformanceTestService.java index 06c22e9466..3119ac55a4 100644 --- a/performance-test/backend/src/main/java/io/metersphere/service/PerformanceTestService.java +++ b/performance-test/backend/src/main/java/io/metersphere/service/PerformanceTestService.java @@ -783,6 +783,15 @@ public class PerformanceTestService { return null; } + public String getRunLogDetails(String id) { + LoadTestWithBLOBs loadTest = loadTestMapper.selectByPrimaryKey(id); + if (loadTest != null) { + OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(loadTest.getId()), loadTest.getProjectId(), loadTest.getName(), loadTest.getCreateUser(), new LinkedList<>()); + return JSON.toJSONString(details); + } + return null; + } + public String deleteBatchLog(DeletePerformanceRequest request) { ServiceUtils.getSelectAllIds(request, request, (query) -> getLoadTestIds(request.getProjectId())); List loadTestIds = request.getIds();