From 31d073b81df723d84ec7ab0c75d94d29492ee28c Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Tue, 10 Oct 2023 10:23:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/sdk/constants/ProjectApplicationType.java | 4 ++-- .../project/request/ProjectApplicationRequest.java | 1 - .../project/service/ProjectApplicationService.java | 2 +- .../project/controller/ProjectApplicationControllerTests.java | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/ProjectApplicationType.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/ProjectApplicationType.java index 15b0909457..d89a03ce74 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/ProjectApplicationType.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/ProjectApplicationType.java @@ -57,7 +57,7 @@ public class ProjectApplicationType { //用例管理-关联需求 public enum CASE_RELATED_CONFIG{ CASE_RELATED, - ENABLE, + CASE_ENABLE, } @@ -70,7 +70,7 @@ public class ProjectApplicationType { //缺陷管理-同步配置项 public enum ISSUE_SYNC_CONFIG{ CRON_EXPRESSION, - ENABLE, + SYNC_ENABLE, MECHANISM, } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/request/ProjectApplicationRequest.java b/backend/services/project-management/src/main/java/io/metersphere/project/request/ProjectApplicationRequest.java index d3526f4528..36efa56eb3 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/request/ProjectApplicationRequest.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/request/ProjectApplicationRequest.java @@ -22,6 +22,5 @@ public class ProjectApplicationRequest implements Serializable { private String projectId; @Schema(description = "配置类型列表", allowableValues = {"WORKSTATION", "TEST_PLAN", "UI", "PERFORMANCE_TEST", "API", "CASE", "ISSUE"}, requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "{project_application.type.not_blank}") private String type; } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java index 811e29e0c5..23a5af0e76 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java @@ -228,7 +228,7 @@ public class ProjectApplicationService { private void doSaveOrUpdateSchedule(List issueSyncConfigs, String projectId, String currentUser) { List syncCron = issueSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + ProjectApplicationType.ISSUE_SYNC_CONFIG.CRON_EXPRESSION.name())).collect(Collectors.toList()); - List syncEnable = issueSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + ProjectApplicationType.ISSUE_SYNC_CONFIG.ENABLE.name())).collect(Collectors.toList()); + List syncEnable = issueSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + ProjectApplicationType.ISSUE_SYNC_CONFIG.SYNC_ENABLE.name())).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(syncCron)) { Boolean enable = Boolean.valueOf(syncEnable.get(0).getTypeValue()); String typeValue = syncCron.get(0).getTypeValue(); diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectApplicationControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectApplicationControllerTests.java index 999f4ab74e..0a7536d273 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectApplicationControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectApplicationControllerTests.java @@ -529,7 +529,7 @@ public class ProjectApplicationControllerTests extends BaseTest { configs.put("jiraIssueTypeId", "10086"); configs.put("jiraStoryTypeId", "10010"); configs.put("CRON_EXPRESSION", "0 0 0/1 * * ?"); - configs.put("ENABLE", "true"); + configs.put("SYNC_ENABLE", "true"); configs.put("MECHANISM", "1"); return configs; }