fix(接口测试): 接口定义修改接口保存报错提示

--bug=1040628 --user=王旭 【接口测试】github#30794,接口定义,修改接口保存报错的提示不正确 https://www.tapd.cn/55049933/s/1625826
This commit is contained in:
WangXu10 2024-12-05 15:08:35 +08:00 committed by 刘瑞斌
parent b3034919c1
commit a1223f4cf5
1 changed files with 3 additions and 2 deletions

View File

@ -750,8 +750,9 @@ public class ApiDefinitionService {
MSException.throwException(Translator.get("api_versions_create")); MSException.throwException(Translator.get("api_versions_create"));
} }
criteria.andVersionIdEqualTo(request.getVersionId()); criteria.andVersionIdEqualTo(request.getVersionId());
if (apiDefinitionMapper.countByExample(example) > 0) { List<ApiDefinition> apiDefinitions = apiDefinitionMapper.selectByExample(example);
MSException.throwException(Translator.get("api_definition_url_not_repeating") + " :" + Translator.get("api_definition_module") + ":" + request.getModulePath() + " ," + Translator.get("api_definition_name") + " :" + request.getName()); 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 { } else {