1. swagger2是什么
swagger是一个RESTFUL 接口的文档在线自动生成和功能测试的框架
2. Springboot整合Swagger2
1.创建springboot项目
2.添加依赖
io.springfox springfox-swagger-ui2.9.2 io.springfox springfox-swagger22.9.2
3.添加Swagger2配置类SwaggerConfig
@SpringBootApplication@MapperScan("com.zking.swaggerdemo.mapper")
@EnableSwagger2
@ComponentScan("com.zking.swaggerdemo.utils")
4.API接口编写
5.SpringBoot启动成功后,访问http://localhost:8090/swagger-ui.html即可
成功的效果:



