fix(接口定义): 修改不开启url可重复的判断唯一接口的逻辑 (#15707)

--bug=1014783 --user=王孝刚 【接口测试】接口、场景批量移动,没有校验接口是否重复
https://www.tapd.cn/55049933/s/1199487

Co-authored-by: wxg0103 <727495428@qq.com>
This commit is contained in:
MeterSphere Bot 2022-07-13 10:20:02 +08:00 committed by GitHub
parent ff1ed89eca
commit cabd97b96f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -549,12 +549,12 @@ public class ApiDefinitionService {
Project project = projectMapper.selectByPrimaryKey(request.getProjectId());
ProjectConfig config = projectApplicationService.getSpecificTypeValue(project.getId(), ProjectApplicationType.URL_REPEATABLE.name());
boolean urlRepeat = config.getUrlRepeatable();
if (moduleIdNotExist) {
criteria.andModulePathEqualTo(request.getModulePath());
} else {
criteria.andModuleIdEqualTo(request.getModuleId());
}
if (project != null && urlRepeat) {
if (moduleIdNotExist) {
criteria.andModulePathEqualTo(request.getModulePath());
} else {
criteria.andModuleIdEqualTo(request.getModuleId());
}
criteria.andNameEqualTo(request.getName());
if (apiDefinitionMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("api_definition_name_not_repeating") + " :" + Translator.get("api_definition_module") + ":" + request.getModulePath() + " ," + Translator.get("api_definition_name") + " :" + request.getName() + "-" + request.getPath());