From 3ce915e52faa516b2066f805b45c3c71e6ac2539 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 21 Oct 2021 17:27:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/ApiTestCaseService.java | 11 +++++++--- .../base/mapper/ext/ExtApiTestCaseMapper.java | 2 ++ .../project/head/ProjectHeaderMenus.vue | 6 ++--- .../components/project/home/ProjectHome.vue | 22 +++++++++---------- 4 files changed, 24 insertions(+), 17 deletions(-) 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 1a86a93024..c58de2651d 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -168,7 +168,7 @@ public class ApiTestCaseService { filters.put("status", new ArrayList<>()); } } - if(request.isToUpdate()){ + if (request.isToUpdate()) { Long timestamp = DateUtils.getTimestamp(-3); request.setUpdateTime(timestamp); } @@ -1126,7 +1126,12 @@ public class ApiTestCaseService { return null; } // "environmentId" - environmentId = environmentId.substring(1,environmentId.length()-1); - return apiTestEnvironmentMapper.selectByPrimaryKey(environmentId); + try { + environmentId = environmentId.substring(1, environmentId.length() - 1); + return apiTestEnvironmentMapper.selectByPrimaryKey(environmentId); + } catch (Exception e) { + LogUtil.error("api case environmentId incorrect parsing. api case id: " + caseId); + } + return null; } } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java index 3a559ea102..9c2d119b4f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java @@ -64,4 +64,6 @@ public interface ExtApiTestCaseMapper { * @return ApiEnvironment */ String getApiCaseEnvironment(@Param("caseId") String caseId); + + int moduleCount(@Param("request")ApiTestCaseRequest request); } diff --git a/frontend/src/business/components/project/head/ProjectHeaderMenus.vue b/frontend/src/business/components/project/head/ProjectHeaderMenus.vue index 4639110abc..78ac20a673 100644 --- a/frontend/src/business/components/project/head/ProjectHeaderMenus.vue +++ b/frontend/src/business/components/project/head/ProjectHeaderMenus.vue @@ -20,13 +20,13 @@ popper-class="submenu"> {{ $t('project.file_manage') }} - - {{ $t('project.log') }} - {{ $t('project.code_segment.code_segment') }} + + {{ $t('project.log') }} + {{ $t('project.version_manage') }} diff --git a/frontend/src/business/components/project/home/ProjectHome.vue b/frontend/src/business/components/project/home/ProjectHome.vue index bbaf72ac6c..4a0d9216f5 100644 --- a/frontend/src/business/components/project/home/ProjectHome.vue +++ b/frontend/src/business/components/project/home/ProjectHome.vue @@ -71,17 +71,6 @@ {{ $t('project.file_desc') }} -
-
- -
-
- - {{ $t('project.log') }}
- {{ $t('project.log_desc') }} -
-
{{ $t('project.code_segment_desc') }}
+
+
+ +
+
+ + {{ $t('project.log') }}
+ {{ $t('project.log_desc') }} +
+