前言
swagger-bootstrap-ui是基于swagger接口api实现的一套UI,因swagger原生ui是上下结构的,在浏览接口时不是很清晰,所以,swagger-bootstrap-ui是基于左右菜单风格的方式,适用与我们在开发后台系统左右结构这种风格类似,方便与接口浏览。
引入
1,引入依赖
<!-- swagger-bootstrap-ui依赖于swagger2实现 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.9.6</version>
</dependency>
2,添加SwaggerConfig类
通过@Configuration注解,让Spring来加载该类配置。
通过@EnableSwagger2注解来启用Swagger2。
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean