pom 配置

https://mvnrepository.com/

1
2
3
4
5
6
7
8
9
10
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
1
2
3
// 添加完依赖后,在入口类添加这个注解即可开启 Swagger
// 访问地址:http://localhost:8080/swagger-ui.html
@EnableSwagger2