From 1ca47f0481db9b55fbacbec31a963ddc4be465bc Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 23 Feb 2024 19:38:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=89=A7=E8=A1=8C=E6=97=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E8=B5=84=E6=BA=90=E6=B1=A0=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/ApiExecuteService.java | 16 ++++++++-------- .../body/MsDocumentAssertionElement.java | 8 ++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiExecuteService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiExecuteService.java index bea3bd85f5..f6d7338186 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiExecuteService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiExecuteService.java @@ -393,14 +393,14 @@ public class ApiExecuteService { // 查询接口默认资源池 ProjectApplication resourcePoolConfig = projectApplicationService.getByType(projectId, ProjectApplicationType.API.API_RESOURCE_POOL_ID.name()); // 没有配置接口默认资源池 - if (resourcePoolConfig == null || StringUtils.isBlank(resourcePoolConfig.getTypeValue())) { - Map configMap = new HashMap<>(); - projectApplicationService.putResourcePool(projectId, configMap, "apiTest"); - if (MapUtils.isEmpty(configMap)) { - throw new MSException(ApiResultCode.EXECUTE_RESOURCE_POOL_NOT_CONFIG); - } - return (String) configMap.get(ProjectApplicationType.API.API_RESOURCE_POOL_ID.name()); + Map configMap = new HashMap<>(); + if (resourcePoolConfig != null && StringUtils.isNotBlank(resourcePoolConfig.getTypeValue())) { + configMap.put(ProjectApplicationType.API.API_RESOURCE_POOL_ID.name(), resourcePoolConfig.getTypeValue()); } - return StringUtils.isBlank(resourcePoolConfig.getTypeValue()) ? null : resourcePoolConfig.getTypeValue(); + projectApplicationService.putResourcePool(projectId, configMap, "apiTest"); + if (MapUtils.isEmpty(configMap)) { + throw new MSException(ApiResultCode.EXECUTE_RESOURCE_POOL_NOT_CONFIG); + } + return (String) configMap.get(ProjectApplicationType.API.API_RESOURCE_POOL_ID.name()); } } \ No newline at end of file diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/api/assertion/body/MsDocumentAssertionElement.java b/backend/services/project-management/src/main/java/io/metersphere/project/api/assertion/body/MsDocumentAssertionElement.java index dd37265867..25c35a6a67 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/api/assertion/body/MsDocumentAssertionElement.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/api/assertion/body/MsDocumentAssertionElement.java @@ -63,6 +63,14 @@ public class MsDocumentAssertionElement { * 在执行时组装数据用 */ private String jsonPath; + /** + * 分组id + */ + private String groupId; + /** + * 跨行数 + */ + private int rowspan; /** * 文档断言类型