From a15ee248cbfcd39f3048ab1178a3670676ff1bc6 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 24 Oct 2022 14:59:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=AF=A6=E6=83=85=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018582 --user=李玉号 【系统设置】操作日志-执行性能测试的日志详情显示错误 https://www.tapd.cn/55049933/s/1274255 --- .../controller/PerformanceTestController.java | 2 +- .../io/metersphere/service/PerformanceTestService.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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();