1、pom文件引入
<properties>
<springfox-swagger2-version>2.9.2</springfox-swagger2-version>
</properties>
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-swagger2-version}</version>
</dependency>
2、启动类上加注解 @EnableSwagger2