From 41cd80fc45315b83ba637ea62e396c6d708d3815 Mon Sep 17 00:00:00 2001 From: oppofind <836575280@qq.com> Date: Thu, 7 Jan 2021 23:33:17 +0800 Subject: [PATCH] Fix github #80. --- .../power/doc/template/SpringBootDocBuildTemplate.java | 2 +- src/main/java/com/power/doc/utils/PathUtil.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java b/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java index 9600277..353f0cf 100644 --- a/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java +++ b/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java @@ -169,7 +169,7 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate { } DocletTag pageTag = method.getTagByName(DocTags.PAGE); if (Objects.nonNull(pageTag)) { - String pageUrl = "/" + projectBuilder.getServerUrl() + "/" + pageTag.getValue(); + String pageUrl = projectBuilder.getServerUrl() + "/" + pageTag.getValue(); apiMethodDoc.setPage(UrlUtil.simplifyUrl(pageUrl)); } DocletTag docletTag = method.getTagByName(DocTags.GROUP); diff --git a/src/main/java/com/power/doc/utils/PathUtil.java b/src/main/java/com/power/doc/utils/PathUtil.java index 3c46efa..dd25cbb 100644 --- a/src/main/java/com/power/doc/utils/PathUtil.java +++ b/src/main/java/com/power/doc/utils/PathUtil.java @@ -49,13 +49,14 @@ public class PathUtil { /** * to postman path + * * @param path path * @return String */ - public static String toPostmanPath(String path){ - if(StringUtil.isNotEmpty(path)){ - path = path.replace("{",":"); - path = path.replace("}",""); + public static String toPostmanPath(String path) { + if (StringUtil.isNotEmpty(path)) { + path = path.replace("{", ":"); + path = path.replace("}", ""); return path; } return null;