From f1b9ffea940e25bb506bfaa4151e2009f2cc8043 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 10 Sep 2021 18:18:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=90=8D=E9=87=8D=E5=A4=8D=20--bug=3D1006476?= =?UTF-8?q?=20--user=3D=E8=B5=B5=E5=8B=87=20=E3=80=90github#6059=E3=80=91?= =?UTF-8?q?=E5=88=A0=E9=99=A4c...=20https://www.tapd.cn/55049933/s/1045496?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/service/ApiTestCaseService.java | 2 +- .../io/metersphere/commons/constants/ParamConstants.java | 1 + .../src/main/java/io/metersphere/service/FileService.java | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) 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 b4e8e68358..b43a5bb046 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -280,7 +280,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()); }