步骤一:导入依赖,注意SWAGGER和UI最好保持版本一致,否则可能会遇到不同的坑
<!-- swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
步骤二:在spring boot2中启用swagger2,(注意看我swagger2中如何匹配多个controller的正确写法)
/**
* 湖北金鹏信息技术有限公司 版权所有 © Copyright 2018<br>
*
* @Description: <br>
* @Project: hades <br>
* @CreateDate: Created in 2019/4/3 16:24 <br>
* @Author: xiaozm
*/
@Configuration
@EnableSwagger2
public class SwaggerConf {
@Bean
publi