Progr1mmer 6 роки тому
батько
коміт
bc642af679

+ 3 - 2
swagger-starter/src/main/java/com/yihu/swagger/SwaggerDocsExample.java

@ -25,8 +25,9 @@ public class SwaggerDocsExample {
        String group = "Default";
        //2.定义请求地址 new URL("http://ip:port/v2/api-docs?group=" + groupName)
        URL remoteSwaggerFile = new URL("http://127.0.0.1:10020/v2/api-docs?group=" + group);
        //3.定义文件输出路径 Paths.get("svr/svr-base/build/" + group)
        Path outputFile = Paths.get("svr/svr-base/build/" + group); //文档输出地址
        //3.定义文件输出路径
        String prefix = Thread.currentThread().getContextClassLoader().getResource("").getPath();
        Path outputFile = Paths.get(prefix.substring(prefix.lastIndexOf(":") + 1, prefix.indexOf("target") - 1) + "/build/" + group); //文档输出地址
        Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
                .withMarkupLanguage(MarkupLanguage.ASCIIDOC)