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:
parent
ff1ed89eca
commit
cabd97b96f
|
@ -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 (project != null && urlRepeat) {
|
||||
if (moduleIdNotExist) {
|
||||
criteria.andModulePathEqualTo(request.getModulePath());
|
||||
} else {
|
||||
criteria.andModuleIdEqualTo(request.getModuleId());
|
||||
}
|
||||
if (project != null && urlRepeat) {
|
||||
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());
|
||||
|
|
Loading…
Reference in New Issue