添加swagger
<!-- 添加swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<!-- swagger2-UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
在需要添加swaggerAPI的接口上添加ApiOperation注解
类注解:@Api(tags = "XXXX", description = "XXXX接口")
方法注解:@ApiOperation("XXXXX")