diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java index 88ebd7ccb5..d58331e9ce 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -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()); } diff --git a/backend/src/main/java/io/metersphere/commons/constants/ParamConstants.java b/backend/src/main/java/io/metersphere/commons/constants/ParamConstants.java index 325a152644..3abdeee089 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/ParamConstants.java +++ b/backend/src/main/java/io/metersphere/commons/constants/ParamConstants.java @@ -103,6 +103,7 @@ public interface ParamConstants { this.value = value; } + @Override public String getValue() { return this.value; } diff --git a/backend/src/main/java/io/metersphere/service/FileService.java b/backend/src/main/java/io/metersphere/service/FileService.java index eda7701992..c9b4a57a5c 100644 --- a/backend/src/main/java/io/metersphere/service/FileService.java +++ b/backend/src/main/java/io/metersphere/service/FileService.java @@ -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()); }