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] =?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 bab83344e..5ee4b2191 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 b550511af..d544c4a2a 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)