## 访问地址
http://localhost:9200/swagger-ui.html#
## 环境搭建
spring boot的启动类上添加 @EnableSwagger2 //用于开启Swagger
@SpringBootApplication @EnableSwagger2 //用于开启Swagger public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
## maven加入对应的jar包
<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <!-- swagger2的web界面,导入这个依赖我们就可以通过界面查看文档了--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency>
标签:swagger,##,DemoApplication,访问,2.9,springfox,搭建 From: https://www.cnblogs.com/caoxuekun/p/17421716.html