diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql index b2ae75b5a2..979582241d 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql @@ -43,7 +43,7 @@ CREATE INDEX idx_update_time ON functional_case(update_time); CREATE TABLE IF NOT EXISTS functional_case_blob( `id` VARCHAR(50) NOT NULL COMMENT '功能用例ID' , `steps` LONGTEXT COMMENT '用例步骤(JSON),step_model 为 Step 时启用' , - `text_description` LONGTEXT COMMENT '步骤描述,step_model 为 Text 时启用' , + `text_description` LONGTEXT COMMENT '文本描述,step_model 为 Text 时启用' , `expected_result` LONGTEXT COMMENT '预期结果,step_model 为 Text 时启用' , `prerequisite` LONGTEXT COMMENT '前置条件' , `description` LONGTEXT COMMENT '备注' , diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_4__project_management.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_4__project_management.sql index 77580f5ef8..2ada439b1f 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_4__project_management.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_4__project_management.sql @@ -169,7 +169,7 @@ CREATE TABLE IF NOT EXISTS project_application ( `project_id` VARCHAR(50) NOT NULL COMMENT '项目ID', `type` VARCHAR(50) NOT NULL COMMENT '配置项', - `type_value` VARCHAR(255) COMMENT '配置值', + `type_value` VARCHAR(512) COMMENT '配置值', PRIMARY KEY (project_id, type) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 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 359c85c62e..beb70e4d43 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 @@ -515,4 +515,39 @@ public class ProjectApplicationService { long l = fakeErrorMapper.countByExample(example); return (int) l; } + + + /** + * 获取缺陷项目配置信息 + * + * @param projectId + * @return + */ + public String getProjectBugThirdPartConfig(String projectId) { + ProjectApplicationExample example = new ProjectApplicationExample(); + example.createCriteria().andProjectIdEqualTo(projectId).andTypeLike(ProjectApplicationType.BUG.BUG_SYNC.name() + "_PLATFORM"); + List list = projectApplicationMapper.selectByExample(example); + if (CollectionUtils.isNotEmpty(list)) { + return list.get(0).getTypeValue(); + } + return null; + } + + + /** + * 获取需求项目配置信息 + * + * @param projectId + * @return + */ + public String getProjectDemandThirdPartConfig(String projectId) { + ProjectApplicationExample example = new ProjectApplicationExample(); + example.createCriteria().andProjectIdEqualTo(projectId).andTypeLike(ProjectApplicationType.CASE_RELATED_CONFIG.CASE_RELATED.name() + "_PLATFORM"); + List list = projectApplicationMapper.selectByExample(example); + if (CollectionUtils.isNotEmpty(list)) { + return list.get(0).getTypeValue(); + } + return null; + } + } 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 c643a367b8..e37140dde4 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 @@ -4,6 +4,7 @@ import io.metersphere.project.controller.param.ProjectApplicationDefinition; import io.metersphere.project.controller.param.ProjectApplicationRequestDefinition; import io.metersphere.project.domain.ProjectApplication; import io.metersphere.project.request.ProjectApplicationRequest; +import io.metersphere.project.service.ProjectApplicationService; import io.metersphere.sdk.constants.ProjectApplicationType; import io.metersphere.sdk.util.JSON; import io.metersphere.system.base.BaseTest; @@ -46,6 +47,9 @@ public class ProjectApplicationControllerTests extends BaseTest { @Resource private PluginService pluginService; + @Resource + private ProjectApplicationService projectApplicationService; + public static final String PROJECT_ID = "project_application_test_id"; public static final String TIME_TYPE_VALUE = "3M"; @@ -674,4 +678,21 @@ public class ProjectApplicationControllerTests extends BaseTest { private String address; private String version; } + + + @Test + @Order(40) + public void testGetProjectBugThirdPartConfig() throws Exception { + projectApplicationService.getProjectBugThirdPartConfig(DEFAULT_PROJECT_ID); + projectApplicationService.getProjectBugThirdPartConfig("test_project_id"); + } + + + @Test + @Order(40) + public void testGetProjectDemandThirdPartConfig() throws Exception { + projectApplicationService.getProjectDemandThirdPartConfig(DEFAULT_PROJECT_ID); + projectApplicationService.getProjectDemandThirdPartConfig("test+project_id"); + } + }