From b5f708114be076b1cba1fcfa2df78e21200abe8e Mon Sep 17 00:00:00 2001 From: niudehua <657563945@qq.com> Date: Sat, 6 Mar 2021 22:47:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?knife4j=20=E7=89=88=E6=9C=AC=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=202.x=20=E8=A7=A3=E5=86=B3=20swagger=20=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../swagger/config/SwaggerAutoConfiguration.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index bab83344ee..5ee4b2191d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 2.4.2 - 3.0.2 + 2.0.8 5.1.46 1.2.4 diff --git a/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java b/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java index b550511aff..d544c4a2a2 100644 --- a/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java +++ b/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java @@ -10,15 +10,17 @@ import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpHeaders; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; -import springfox.documentation.service.*; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.service.AuthorizationScope; +import springfox.documentation.service.Contact; +import springfox.documentation.service.SecurityReference; +import springfox.documentation.service.SecurityScheme; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.service.contexts.SecurityContext; import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; -import springfox.documentation.service.ApiKey; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -30,7 +32,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka * @author 芋道源码 */ @Configuration -@EnableSwagger2 +@EnableSwagger2WebMvc @EnableKnife4j @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) @ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true) From 5351917b67177f3cfc338f137e3702d0166b55e6 Mon Sep 17 00:00:00 2001 From: niudehua <657563945@qq.com> Date: Sun, 7 Mar 2021 21:06:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BC=95=E5=85=A5=20swagger-annotations=20?= =?UTF-8?q?1.5.22=20=E6=8E=92=E9=99=A4knife4j3.0.2=20=E4=B8=AD=20swagger-a?= =?UTF-8?q?nnotations=20=E8=A7=A3=E5=86=B3=E4=BE=9D=E8=B5=96=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 14 ++++++++++++-- .../swagger/config/SwaggerAutoConfiguration.java | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 5ee4b2191d..a601b907d6 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ - 4.0.0 + 4.0.0 cn.iocoder dashboard @@ -24,7 +24,8 @@ 2.4.2 - 2.0.8 + 3.0.2 + 1.5.22 5.1.46 1.2.4 @@ -104,8 +105,17 @@ guava com.google.guava + + swagger-annotations + io.swagger + + + io.swagger + swagger-annotations + ${swagger-annotations.version} + diff --git a/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java b/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java index d544c4a2a2..21511c37c4 100644 --- a/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java +++ b/src/main/java/cn/iocoder/dashboard/framework/swagger/config/SwaggerAutoConfiguration.java @@ -19,7 +19,7 @@ import springfox.documentation.service.SecurityScheme; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.service.contexts.SecurityContext; import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; +import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.Collections; import java.util.List; @@ -32,7 +32,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka * @author 芋道源码 */ @Configuration -@EnableSwagger2WebMvc +@EnableSwagger2 @EnableKnife4j @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) @ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true)