update swagger 升级为 knife4j

This commit is contained in:
疯狂的狮子li
2021-03-16 12:52:09 +08:00
parent c0186580ba
commit 31ddb2aee3
4 changed files with 30 additions and 43 deletions

View File

@ -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驱动包 -->

View File

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