From 579ff5d35ffa7aebac44683f5307fbc963fa861a Mon Sep 17 00:00:00 2001 From: Jianguo-Genius Date: Fri, 25 Oct 2024 17:04:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20fi?= =?UTF-8?q?x=20api=20scenario=20steps=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.tapd.cn/55049933/s/1598530 --- .../api/service/ApiScenarioDataTransferService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiScenarioDataTransferService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiScenarioDataTransferService.java index 1ca1610a14..4d79cbd9d6 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiScenarioDataTransferService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiScenarioDataTransferService.java @@ -1218,9 +1218,7 @@ public class ApiScenarioDataTransferService { response.addExportApiCase(dto); } } - } else { - // 普通导出,所有的引用都改为复制,并且Api、ApiCase改为CUSTOM_REQUEST Map stepApiDefinitionMap = new HashMap<>(); Map stepApiCaseMap = new HashMap<>(); @@ -1234,8 +1232,13 @@ public class ApiScenarioDataTransferService { stepApiCaseMap.put(step.getId(), step.getResourceId()); } } + + if (StringUtils.equalsIgnoreCase(step.getStepType(), ApiScenarioStepType.API.name())) { + step.setStepType(ApiScenarioStepType.CUSTOM_REQUEST.name()); + } else if (StringUtils.equalsIgnoreCase(step.getStepType(), ApiScenarioStepType.API_CASE.name())) { + step.setStepType(ApiScenarioStepType.CUSTOM_REQUEST.name()); + } step.setRefType(ApiScenarioStepRefType.COPY.name()); - step.setStepType(ApiScenarioStepType.CUSTOM_REQUEST.name()); } }); Map appendBlobMap = new HashMap<>();