From 5f11ab9de026ee93829c01ed1e15b5d244c6fcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9A=AE=E5=85=89=EF=BC=9A=E5=9F=8E=E4=B8=AD=E5=9F=8E?= <806783409@qq.com> Date: Sun, 9 Dec 2018 22:51:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E7=8B=AC=E9=A1=B5=E9=9D=A2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E6=9B=B4=E5=8A=A0=E6=96=B9=E4=BE=BF=EF=BC=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=9B=B4=E6=B8=85=E6=99=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MgDocumentController.java | 44 +++--- .../src/main/resources/document.html | 148 ++---------------- .../resources/webjars/mg-ui/css/mg-ui.css | 4 + .../main/resources/webjars/mg-ui/js/common.js | 60 +++++-- .../resources/webjars/mg-ui/js/mg-ui-debug.js | 2 +- .../main/resources/webjars/mg-ui/js/mg-ui.js | 131 +++++----------- .../main/resources/webjars/mg-ui/js/toast.js | 7 + .../webjars/zpages/debugDataConfig.html | 37 +++++ .../webjars/zpages/docShowConfig.html | 110 ++++++++++++- .../webjars/zpages/docUrlConfig.html | 140 +++++++++++++++++ .../webjars/zpages/globalParamConfig.html | 37 +++++ 11 files changed, 455 insertions(+), 265 deletions(-) create mode 100644 zyplayer-doc-swagger/src/main/resources/webjars/zpages/debugDataConfig.html create mode 100644 zyplayer-doc-swagger/src/main/resources/webjars/zpages/docUrlConfig.html create mode 100644 zyplayer-doc-swagger/src/main/resources/webjars/zpages/globalParamConfig.html diff --git a/zyplayer-doc-swagger/src/main/java/com/zyplayer/doc/swagger/controller/MgDocumentController.java b/zyplayer-doc-swagger/src/main/java/com/zyplayer/doc/swagger/controller/MgDocumentController.java index 1746d8e0..5c55d1b8 100644 --- a/zyplayer-doc-swagger/src/main/java/com/zyplayer/doc/swagger/controller/MgDocumentController.java +++ b/zyplayer-doc-swagger/src/main/java/com/zyplayer/doc/swagger/controller/MgDocumentController.java @@ -215,28 +215,28 @@ public class MgDocumentController { } String resourcesStr = null; try { - resourcesStr = HttpRequest.get(resourcesUrl).timeout(3000).execute().body(); - List resourceList = JSON.parseArray(resourcesStr, SwaggerResource.class); - if (resourceList == null || resourceList.isEmpty()) { - return DocResponseJson.warn("该地址未找到文档"); - } - // 重新加入的时候把之前的已删除的回恢复 - String resourcesDomain = resourcesUrl.substring(0, resourcesUrl.lastIndexOf("/") + 1); - for (SwaggerResource swaggerResource : resourceList) { - String location = swaggerResource.getLocation(); - // 最后一个斜杠在resourcesUrl中已经加上,替换掉后面的防止两根斜杠 - location = location.startsWith("/") ? location.replaceFirst("/", "") : location; - if (location.indexOf("?") >= 0) { - try { - String encode = URLEncoder.encode(swaggerResource.getName(), "utf-8"); - location = location.substring(0, location.lastIndexOf("?")) + "?group=" + encode; - } catch (Exception e) { - e.printStackTrace(); - } - } - location = resourcesDomain + location; - swaggerDocsDeleteSet.remove(location); - } +// resourcesStr = HttpRequest.get(resourcesUrl).timeout(3000).execute().body(); +// List resourceList = JSON.parseArray(resourcesStr, SwaggerResource.class); +// if (resourceList == null || resourceList.isEmpty()) { +// return DocResponseJson.warn("该地址未找到文档"); +// } +// // 重新加入的时候把之前的已删除的回恢复 +// String resourcesDomain = resourcesUrl.substring(0, resourcesUrl.lastIndexOf("/") + 1); +// for (SwaggerResource swaggerResource : resourceList) { +// String location = swaggerResource.getLocation(); +// // 最后一个斜杠在resourcesUrl中已经加上,替换掉后面的防止两根斜杠 +// location = location.startsWith("/") ? location.replaceFirst("/", "") : location; +// if (location.indexOf("?") >= 0) { +// try { +// String encode = URLEncoder.encode(swaggerResource.getName(), "utf-8"); +// location = location.substring(0, location.lastIndexOf("?")) + "?group=" + encode; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// location = resourcesDomain + location; +// swaggerDocsDeleteSet.remove(location); +// } resourcesSet.add(resourcesUrl); } catch (Exception e) { // 暂不想支持直接添加地址 diff --git a/zyplayer-doc-swagger/src/main/resources/document.html b/zyplayer-doc-swagger/src/main/resources/document.html index 70208ab3..5e30599f 100644 --- a/zyplayer-doc-swagger/src/main/resources/document.html +++ b/zyplayer-doc-swagger/src/main/resources/document.html @@ -28,14 +28,14 @@
  • 控制台
  • -
  • +
  • 文档管理
  • @@ -45,85 +45,25 @@
    +
    -
    +
    -
    配置中心
    +
    工具介绍
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    目录展示方式 - - -
    树形菜单展示方式 - - - - - -
    是否展示字段的类型 - - -
    仅使用上次请求参数 - - -
    自动填充请求参数 - - - -
    文档管理 - - -
    配置管理 - - - -
    -
    简介
    - zyplayer-doc-swagger是swagger-ui的一个前端实现,使用简单、解析速度快、走心的设计, - 支持多项目同时展示,多种文档目录的展示方案,多种自定义配置,满足各种使用习惯。 - 本项目是完全从头写的,所以有任何属性未解析到、UI上有何建议都能及时处理得到。 - 使用中您有任何的意见和建议都可到源码地址处反馈哦!
    - 源码地址:zyplayer-doc-swagger, - 前端框架:zui, - 我的网站:空间轴 -
    +
    + zyplayer-doc-swagger是swagger文档的管理工具,使用简单、解析速度快、走心的设计, + 支持多项目同时展示,多种文档目录的展示方案,多种自定义配置,满足各种使用习惯。 + 本项目是完全从头写的,所以有任何属性未解析到、UI上有何建议都能及时处理得到。 + 使用中您有任何的意见和建议都可到源码地址处反馈哦!
    + 源码地址:zyplayer-doc-swagger(还有其他很多功能哦), + 前端框架:zui(很不错), + 我的网站:空间轴自由发挥(都已很久未维护)
    @@ -399,25 +339,6 @@
    - -
    - - - -