fix(系统设置): 执行性能测试的日志详情显示错误

--bug=1018582 --user=李玉号 【系统设置】操作日志-执行性能测试的日志详情显示错误
https://www.tapd.cn/55049933/s/1274255
This commit is contained in:
shiziyuan9527 2022-10-24 14:59:23 +08:00 committed by lyh
parent 94eb830a28
commit a15ee248cb
2 changed files with 10 additions and 1 deletions

View File

@ -182,7 +182,7 @@ public class PerformanceTestController {
} }
@PostMapping("/run") @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) @RequiresPermissions(PermissionConstants.PROJECT_PERFORMANCE_TEST_READ_RUN)
public String run(@RequestBody RunTestPlanRequest request) { public String run(@RequestBody RunTestPlanRequest request) {
return performanceTestService.run(request); return performanceTestService.run(request);

View File

@ -783,6 +783,15 @@ public class PerformanceTestService {
return null; 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) { public String deleteBatchLog(DeletePerformanceRequest request) {
ServiceUtils.getSelectAllIds(request, request, (query) -> getLoadTestIds(request.getProjectId())); ServiceUtils.getSelectAllIds(request, request, (query) -> getLoadTestIds(request.getProjectId()));
List<String> loadTestIds = request.getIds(); List<String> loadTestIds = request.getIds();