From 31ddb2aee38995b7e4b4759d135667429dd41f06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?=
<15040126243@163.com>
Date: Tue, 16 Mar 2021 12:52:09 +0800
Subject: [PATCH] =?UTF-8?q?update=20swagger=20=E5=8D=87=E7=BA=A7=E4=B8=BA?=
=?UTF-8?q?=20knife4j?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 2 +-
pom.xml | 24 ++----------
ruoyi-admin/pom.xml | 39 +++++++++++--------
.../ruoyi/web/core/config/SwaggerConfig.java | 8 ++--
4 files changed, 30 insertions(+), 43 deletions(-)
diff --git a/README.md b/README.md
index 2352aa86..29e305b4 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@
* 容器改动 Tomcat 改为 并发性能更好的 undertow
* 代码生成模板 改为适配 Mybatis-Plus 的代码
* 项目修改为 maven多环境配置
-* swagger 修改为 swagger-bootstrap-ui
+* swagger 修改为 knife4j
* 集成 Hutool 5.X 并重写RuoYi部分功能
* 集成 Feign 接口化管理 Http 请求(如三方请求 支付,短信,推送等)
* 升级MybatisPlus 3.4.2
diff --git a/pom.xml b/pom.xml
index f6e4b03e..ba9aa6d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,8 +19,7 @@
1.8
3.1.1
1.2.4
- 2.9.2
- 1.9.6
+ 2.0.8
1.3.0
1.2.75
5.6.0
@@ -86,27 +85,10 @@
${jna.version}
-
-
- io.springfox
- springfox-swagger2
- ${swagger.version}
-
-
- io.swagger
- swagger-annotations
-
-
- io.swagger
- swagger-models
-
-
-
-
com.github.xiaoymin
- swagger-bootstrap-ui
- ${swagger-ui.version}
+ knife4j-spring-boot-starter
+ ${knife4j.version}
diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml
index 94316f57..32977f3e 100644
--- a/ruoyi-admin/pom.xml
+++ b/ruoyi-admin/pom.xml
@@ -24,28 +24,33 @@
true
-
-
- io.springfox
- springfox-swagger2
-
+
+
+
+
+
-
-
- io.swagger
- swagger-annotations
- 1.5.21
-
+
+
+
+
+
+
-
- io.swagger
- swagger-models
- 1.5.21
-
+
+
+
+
+
+
+
+
+
+
com.github.xiaoymin
- swagger-bootstrap-ui
+ knife4j-spring-boot-starter
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
index 0479891e..96570815 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
@@ -1,6 +1,6 @@
package com.ruoyi.web.core.config;
-import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@@ -14,7 +14,7 @@ import springfox.documentation.service.*;
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.swagger2.annotations.EnableSwagger2WebMvc;
import java.util.ArrayList;
import java.util.List;
@@ -25,8 +25,8 @@ import java.util.List;
* @author ruoyi
*/
@Configuration
-@EnableSwagger2
-@EnableSwaggerBootstrapUI
+@EnableSwagger2WebMvc
+@EnableKnife4j
public class SwaggerConfig
{
/** 系统基础配置 */