From fe7d3b1d486f96ff978237be349cd3e184b59430 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 9 Feb 2022 18:18:51 +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=8D=E5=BC=95=E7=94=A8=E5=9C=BA=E6=99=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010071 --user=赵勇 【接口测试】场景,引用其他场景后,显示原始用例已删除 https://www.tapd.cn/55049933/s/1102416 --- .../api/controller/ApiAutomationController.java | 2 +- .../metersphere/api/service/ApiAutomationService.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java index a9610d3a27..f14194c652 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -192,7 +192,7 @@ public class ApiAutomationController { @PostMapping("/getApiScenarios") public List getApiScenarios(@RequestBody List ids) { - return apiAutomationService.getApiScenarios(ids); + return apiAutomationService.getNewApiScenarios(ids); } @PostMapping(value = "/run/debug") diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 81af380210..7f7302877f 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -728,6 +728,17 @@ public class ApiAutomationService { return new ArrayList<>(); } + public List getNewApiScenarios(List ids) { + List list = new LinkedList<>(); + if (CollectionUtils.isNotEmpty(ids)) { + ids.forEach(item -> { + ApiScenarioDTO dto = this.getNewApiScenario(item); + list.add(dto); + }); + } + return list; + } + public byte[] loadFileAsBytes(FileOperationRequest fileOperationRequest) { if (fileOperationRequest.getId().contains("/") || fileOperationRequest.getName().contains("/")) MSException.throwException(Translator.get("invalid_parameter"));