From 002da225d800dfc0f2bce716c545ef6689ccee63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=8F=AF=E8=80=90?= <46134044+sdhzwc@users.noreply.github.com> Date: Thu, 7 Nov 2024 14:46:21 +0800 Subject: [PATCH] [Improvement-16773][Parameter] Create project parameters-Field modify user adds default value (#16775) --- .../api/service/impl/ProjectParameterServiceImpl.java | 1 + .../api/service/ProjectParameterServiceTest.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectParameterServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectParameterServiceImpl.java index e23101da36..f0e157eaa3 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectParameterServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectParameterServiceImpl.java @@ -101,6 +101,7 @@ public class ProjectParameterServiceImpl extends BaseServiceImpl implements Proj .code(CodeGenerateUtils.genCode()) .projectCode(projectCode) .userId(loginUser.getId()) + .operator(loginUser.getId()) .createTime(now) .updateTime(now) .build(); diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectParameterServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectParameterServiceTest.java index ef8ffd2768..c7d6dc73d6 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectParameterServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectParameterServiceTest.java @@ -114,6 +114,9 @@ public class ProjectParameterServiceTest { result = projectParameterService.createProjectParameter(loginUser, projectCode, "key1", "value", DataType.VARCHAR.name()); assertEquals(Status.SUCCESS.getCode(), result.getCode()); + + ProjectParameter projectParameter = (ProjectParameter) result.getData(); + assertEquals(loginUser.getId(), projectParameter.getOperator()); } @Test