From a1223f4cf57ddce89206783d06eae029b2ae826e Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Thu, 5 Dec 2024 15:08:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E4=BF=AE=E6=94=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=9D=E5=AD=98=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1040628 --user=王旭 【接口测试】github#30794,接口定义,修改接口保存报错的提示不正确 https://www.tapd.cn/55049933/s/1625826 --- .../metersphere/service/definition/ApiDefinitionService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java index 42b15ea2be..dea2525c8e 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java @@ -750,8 +750,9 @@ public class ApiDefinitionService { MSException.throwException(Translator.get("api_versions_create")); } criteria.andVersionIdEqualTo(request.getVersionId()); - if (apiDefinitionMapper.countByExample(example) > 0) { - MSException.throwException(Translator.get("api_definition_url_not_repeating") + " :" + Translator.get("api_definition_module") + ":" + request.getModulePath() + " ," + Translator.get("api_definition_name") + " :" + request.getName()); + List apiDefinitions = apiDefinitionMapper.selectByExample(example); + if (CollectionUtils.isNotEmpty(apiDefinitions)) { + MSException.throwException(Translator.get("api_definition_url_not_repeating") + " :" + Translator.get("api_definition_module") + ":" + apiDefinitions.get(0).getModulePath() + " ," + Translator.get("api_definition_name") + " :" + apiDefinitions.get(0).getName()); } } } else {