update swagger 升级为 knife4j

feature/model
疯狂的狮子li 4 years ago
parent c0186580ba
commit 31ddb2aee3

@ -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

@ -19,8 +19,7 @@
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.4</druid.version>
<swagger.version>2.9.2</swagger.version>
<swagger-ui.version>1.9.6</swagger-ui.version>
<knife4j.version>2.0.8</knife4j.version>
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
<fastjson.version>1.2.75</fastjson.version>
<oshi.version>5.6.0</oshi.version>
@ -86,27 +85,10 @@
<version>${jna.version}</version>
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>${swagger-ui.version}</version>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>${knife4j.version}</version>
</dependency>
<!-- excel工具 -->

@ -24,28 +24,33 @@
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<!-- &lt;!&ndash; swagger2&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger2</artifactId>-->
<!-- </dependency>-->
<!--防止进入swagger页面报类型转换错误排除2.9.2中的引用手动增加1.5.21版本-->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<!-- &lt;!&ndash;防止进入swagger页面报类型转换错误排除2.9.2中的引用手动增加1.5.21版本&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-annotations</artifactId>-->
<!-- <version>1.5.21</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-models</artifactId>-->
<!-- <version>1.5.21</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.github.xiaoymin</groupId>-->
<!-- <artifactId>swagger-bootstrap-ui</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
<!-- Mysql驱动包 -->

@ -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
{
/** 系统基础配置 */

Loading…
Cancel
Save