From a40fcf55285ff10a8775b1090c742fda7b692a2c Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Wed, 14 Aug 2024 17:35:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=89=B9=E9=87=8F=E5=90=8C=E6=AD=A5=EF=BC=8C?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E7=BC=BA=E5=B0=91=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1045134 --user=陈建星 【接口测试】定义-CASE-勾选CASE-批量同步-查看CASE的变更历史-操作人显示为- https://www.tapd.cn/55049933/s/1562814 --- .../api/service/definition/ApiTestCaseLogService.java | 4 ++-- .../api/service/definition/ApiTestCaseService.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseLogService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseLogService.java index 8675faa51f..073b55bc23 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseLogService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseLogService.java @@ -236,7 +236,7 @@ public class ApiTestCaseLogService { saveBatchLog(projectId, apiTestCases, operator, OperationLogType.RECOVER.name(), false, OperationLogModule.API_TEST_MANAGEMENT_RECYCLE); } - public void batchSyncLog(Map originMap, Map modifiedMap, Project project) { + public void batchSyncLog(Map originMap, Map modifiedMap, Project project, String userId) { List logs = new ArrayList<>(); originMap.forEach((id, origin) -> { ApiTestCaseLogDTO modified = modifiedMap.get(id); @@ -251,7 +251,7 @@ public class ApiTestCaseLogService { .method(HttpMethodConstants.POST.name()) .sourceId(id) .content(origin.getName()) - .createUser(null) + .createUser(userId) .path(OperationLogAspect.getPath()) .originalValue(ApiDataUtils.toJSONBytes(origin)) .modifiedValue(ApiDataUtils.toJSONBytes(modified)) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java index 7289e64692..bc7313d642 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java @@ -1062,7 +1062,7 @@ public class ApiTestCaseService extends MoveNodeService { modifiedMap.put(apiTestCase.getId(), originCase); } } - apiTestCaseLogService.batchSyncLog(originMap, modifiedMap, project); + apiTestCaseLogService.batchSyncLog(originMap, modifiedMap, project, userId); User user = userMapper.selectByPrimaryKey(userId); apiTestCaseNoticeService.batchSyncSendNotice(new ArrayList<>(modifiedMap.values()), user, project.getId(), request.getNotificationConfig(), NoticeConstants.Event.CASE_UPDATE);