From 33ccd948a285658f0287e63904c50d0d4bdafad7 Mon Sep 17 00:00:00 2001 From: Jianguo-Genius Date: Mon, 23 Sep 2024 11:08:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E9=92=88=E5=AF=B9tcp=E5=AF=BC=E5=85=A5=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E5=90=8C=E5=90=8D=E4=B8=8D=E5=90=8C=E5=BE=84=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=81=9A=E4=BC=98=E5=8C=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1046934 --user=宋天阳 【接口测试】接口导入-MeterSphere格式-tcp请求-A模块下有B模块-且A模块下与B模块下存在同名的TCP接口-导入项目后,只导入显示了A模块下的一个接口 https://www.tapd.cn/55049933/s/1583426 --- .../api/parser/api/MetersphereParserApiDefinition.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereParserApiDefinition.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereParserApiDefinition.java index 76b22044b3..2369a554a0 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereParserApiDefinition.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/MetersphereParserApiDefinition.java @@ -1,7 +1,6 @@ package io.metersphere.api.parser.api; -import io.metersphere.api.domain.ApiDefinition; import io.metersphere.api.dto.converter.ApiDefinitionDetail; import io.metersphere.api.dto.converter.ApiDefinitionExportDetail; import io.metersphere.api.dto.converter.ApiImportDataAnalysisResult; @@ -94,7 +93,7 @@ public class MetersphereParserApiDefinition implements ApiDefinitionImportParser }); } else { //非HTTP类型,通过 name判断,后续处理会过滤掉路径不一致的 - Map importDataMap = importDetail.stream().collect(Collectors.toMap(ApiDefinition::getName, t -> t, (oldValue, newValue) -> newValue)); + Map importDataMap = importDetail.stream().collect(Collectors.toMap(t -> t.getModulePath() + t.getName(), t -> t, (oldValue, newValue) -> newValue)); Map> savedApiDefinitionMap = existenceApiDefinitionList.stream().collect(Collectors.groupingBy(ApiDefinitionDetail::getName)); importDataMap.forEach((key, api) -> {