From 88ccf74d672fb61d456b622f0a998e7e05b5cc01 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 19 Dec 2023 13:54:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddubbo=E5=8D=8F=E8=AE=AE=E5=92=8Csql=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E6=98=BE=E7=A4=BA=E8=B5=84=E6=BA=90=E6=B1=A0=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1033318 --user=王孝刚 【接口测试】github#27787,dubbo接口TEST的时候,资源池跟项目设置使用的资源池不一致,一直是Local https://www.tapd.cn/55049933/s/1445299 --bug=1033062 --user=王孝刚 【接口测试】场景详情-设置显示系统模块-调试按钮显示换行 https://www.tapd.cn/55049933/s/1445371 --- .../definition/ApiDefinitionEnvService.java | 29 ++++++++++++------- .../automation/scenario/EditApiScenario.vue | 6 ++++ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionEnvService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionEnvService.java index 9cee9d5c6e..6df49b32bf 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionEnvService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionEnvService.java @@ -3,15 +3,13 @@ package io.metersphere.service.definition; import io.metersphere.api.dto.ApiReportEnvConfigDTO; import io.metersphere.api.dto.MsgDTO; import io.metersphere.api.dto.RequestResultExpandDTO; -import io.metersphere.base.domain.ApiDefinitionEnv; -import io.metersphere.base.domain.ApiDefinitionEnvExample; -import io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs; -import io.metersphere.base.domain.ApiTestEnvironmentExample; +import io.metersphere.base.domain.*; import io.metersphere.base.mapper.ApiDefinitionEnvMapper; import io.metersphere.base.mapper.ApiDefinitionExecResultMapper; import io.metersphere.base.mapper.ApiTestEnvironmentMapper; import io.metersphere.commons.utils.JSON; import io.metersphere.dto.RequestResult; +import io.metersphere.service.BaseTestResourcePoolService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -33,6 +31,8 @@ public class ApiDefinitionEnvService { private ApiDefinitionExecResultMapper apiDefinitionExecResultMapper; @Resource private ApiDefinitionService apiDefinitionService; + @Resource + private BaseTestResourcePoolService baseTestResourcePoolService; public void insert(ApiDefinitionEnv env) { env.setId(UUID.randomUUID().toString()); @@ -93,12 +93,21 @@ public class ApiDefinitionEnvService { if (StringUtils.isNotBlank(dto.getToReport())) { ApiDefinitionExecResultWithBLOBs result = apiDefinitionExecResultMapper.selectByPrimaryKey(dto.getToReport()); if (result != null && StringUtils.isNotEmpty(result.getEnvConfig())) { - ApiReportEnvConfigDTO envConfig = apiDefinitionService.getEnvNameByEnvConfig(result.getProjectId(), result.getEnvConfig()); - if (envConfig != null) { - Map map = JSON.parseObject(dto.getContent().substring(7), Map.class); - map.put("envName", envConfig.getEnvName()); - map.put("poolName", envConfig.getResourcePoolName()); - dto.setContent("result_" + JSON.toJSONString(map)); + if (StringUtils.equals("null",result.getEnvConfig())) { + if (StringUtils.isNotBlank(result.getActuator())) { + Map map = JSON.parseObject(dto.getContent().substring(7), Map.class); + TestResourcePool resourcePool = baseTestResourcePoolService.getResourcePool(result.getActuator()); + map.put("poolName", resourcePool.getName()); + dto.setContent("result_" + JSON.toJSONString(map)); + } + } else { + ApiReportEnvConfigDTO envConfig = apiDefinitionService.getEnvNameByEnvConfig(result.getProjectId(), result.getEnvConfig()); + if (envConfig != null) { + Map map = JSON.parseObject(dto.getContent().substring(7), Map.class); + map.put("envName", envConfig.getEnvName()); + map.put("poolName", envConfig.getResourcePoolName()); + dto.setContent("result_" + JSON.toJSONString(map)); + } } } } diff --git a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue index 6b69225efc..eee7c12359 100644 --- a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue +++ b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue @@ -2962,6 +2962,12 @@ export default { vertical-align: center; } + + :deep(.el-dropdown .el-button-group) { + display: flex; + } + + :deep(.ms-main-container) { padding: 5px 5px 5px 10px; }