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);