feat(接口定义):用例名重复

--bug=1006476 --user=赵勇 【github#6059】删除c... https://www.tapd.cn/55049933/s/1045496
This commit is contained in:
wxg0103 2021-09-10 18:18:53 +08:00 committed by fit2-zhao
parent c2987076eb
commit 9f49f57a8f
3 changed files with 8 additions and 1 deletions

View File

@ -273,7 +273,7 @@ public class ApiTestCaseService {
public ApiTestCase getSameCase(SaveApiTestCaseRequest request) {
ApiTestCaseExample example = new ApiTestCaseExample();
ApiTestCaseExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(request.getName()).andApiDefinitionIdEqualTo(request.getApiDefinitionId());
criteria.andStatusNotEqualTo("Trash").andNameEqualTo(request.getName()).andApiDefinitionIdEqualTo(request.getApiDefinitionId());
if (StringUtils.isNotBlank(request.getId())) {
criteria.andIdNotEqualTo(request.getId());
}

View File

@ -103,6 +103,7 @@ public interface ParamConstants {
this.value = value;
}
@Override
public String getValue() {
return this.value;
}

View File

@ -158,6 +158,12 @@ public class FileService {
private FileType getFileType(String filename) {
int s = filename.lastIndexOf(".") + 1;
String type = filename.substring(s);
FileType type1 =FileType.valueOf(type.toUpperCase());
for (FileType type2:FileType.values()) {
if (!type1.equals(type2)){
return null;
}
}
return FileType.valueOf(type.toUpperCase());
}