refactor(项目管理): 菜单管理配置联调

This commit is contained in:
WangXu10 2023-10-10 10:23:31 +08:00 committed by fit2-zhao
parent c90772bb05
commit 31d073b81d
4 changed files with 4 additions and 5 deletions

View File

@ -57,7 +57,7 @@ public class ProjectApplicationType {
//用例管理-关联需求 //用例管理-关联需求
public enum CASE_RELATED_CONFIG{ public enum CASE_RELATED_CONFIG{
CASE_RELATED, CASE_RELATED,
ENABLE, CASE_ENABLE,
} }
@ -70,7 +70,7 @@ public class ProjectApplicationType {
//缺陷管理-同步配置项 //缺陷管理-同步配置项
public enum ISSUE_SYNC_CONFIG{ public enum ISSUE_SYNC_CONFIG{
CRON_EXPRESSION, CRON_EXPRESSION,
ENABLE, SYNC_ENABLE,
MECHANISM, MECHANISM,
} }

View File

@ -22,6 +22,5 @@ public class ProjectApplicationRequest implements Serializable {
private String projectId; private String projectId;
@Schema(description = "配置类型列表", allowableValues = {"WORKSTATION", "TEST_PLAN", "UI", "PERFORMANCE_TEST", "API", "CASE", "ISSUE"}, requiredMode = Schema.RequiredMode.REQUIRED) @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; private String type;
} }

View File

@ -228,7 +228,7 @@ public class ProjectApplicationService {
private void doSaveOrUpdateSchedule(List<ProjectApplication> issueSyncConfigs, String projectId, String currentUser) { private void doSaveOrUpdateSchedule(List<ProjectApplication> issueSyncConfigs, String projectId, String currentUser) {
List<ProjectApplication> syncCron = issueSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + ProjectApplicationType.ISSUE_SYNC_CONFIG.CRON_EXPRESSION.name())).collect(Collectors.toList()); List<ProjectApplication> syncCron = issueSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + ProjectApplicationType.ISSUE_SYNC_CONFIG.CRON_EXPRESSION.name())).collect(Collectors.toList());
List<ProjectApplication> syncEnable = issueSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + ProjectApplicationType.ISSUE_SYNC_CONFIG.ENABLE.name())).collect(Collectors.toList()); List<ProjectApplication> 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)) { if (CollectionUtils.isNotEmpty(syncCron)) {
Boolean enable = Boolean.valueOf(syncEnable.get(0).getTypeValue()); Boolean enable = Boolean.valueOf(syncEnable.get(0).getTypeValue());
String typeValue = syncCron.get(0).getTypeValue(); String typeValue = syncCron.get(0).getTypeValue();

View File

@ -529,7 +529,7 @@ public class ProjectApplicationControllerTests extends BaseTest {
configs.put("jiraIssueTypeId", "10086"); configs.put("jiraIssueTypeId", "10086");
configs.put("jiraStoryTypeId", "10010"); configs.put("jiraStoryTypeId", "10010");
configs.put("CRON_EXPRESSION", "0 0 0/1 * * ?"); configs.put("CRON_EXPRESSION", "0 0 0/1 * * ?");
configs.put("ENABLE", "true"); configs.put("SYNC_ENABLE", "true");
configs.put("MECHANISM", "1"); configs.put("MECHANISM", "1");
return configs; return configs;
} }