From b7a2cd5e430e714e958a581bf466a60f8635a212 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Wed, 3 Nov 2021 17:10:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20#1?= =?UTF-8?q?007602=20API=E6=96=87=E6=A1=A3=E6=9F=A5=E9=98=85=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=81Mock=E5=8C=B9=E9=85=8D=E5=88=B0=E4=BA=86SQL?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API文档查阅问题、Mock匹配到了SQL请求的问题 --- .../api/service/ApiDefinitionService.java | 5 +- .../components/document/ApiDocumentAnchor.vue | 379 +----------- .../document/components/ApiInformation.vue | 580 ++++++++++++++++++ 3 files changed, 598 insertions(+), 366 deletions(-) create mode 100644 frontend/src/business/components/api/definition/components/document/components/ApiInformation.vue diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 29e24cf5b9..f4887428e0 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -1474,7 +1474,7 @@ public class ApiDefinitionService { return new ArrayList<>(); } else { ApiDefinitionExample example = new ApiDefinitionExample(); - example.createCriteria().andMethodEqualTo(method).andProjectIdEqualTo(projectId); + example.createCriteria().andMethodEqualTo(method).andProjectIdEqualTo(projectId).andStatusNotEqualTo("Trash").andProtocolEqualTo("HTTP"); List apiList = apiDefinitionMapper.selectByExample(example); List apiIdList = new ArrayList<>(); @@ -1489,6 +1489,9 @@ public class ApiDefinitionService { } for (ApiDefinition api : apiList) { String path = api.getPath(); + if(StringUtils.isEmpty(path)){ + continue; + } if (path.startsWith("/")) { path = path.substring(1); } diff --git a/frontend/src/business/components/api/definition/components/document/ApiDocumentAnchor.vue b/frontend/src/business/components/api/definition/components/document/ApiDocumentAnchor.vue index ac581cb2dd..510fdb29a2 100644 --- a/frontend/src/business/components/api/definition/components/document/ApiDocumentAnchor.vue +++ b/frontend/src/business/components/api/definition/components/document/ApiDocumentAnchor.vue @@ -1,7 +1,8 @@