2019年5月22日记
需求:前端需要一份接口文档,进行接口联调。接口经常变动,所以需要重新编辑接口doc文档,发送给前端。十分不方便,基于此我们引入swagger,让我们更好的写API文档,还可以完全模拟http请求。
废话不多说,先让代码(很简单)跑起来。看效果
代码的地址:https://gitee.com/tcyj/SpringbootSwaggerDemo.git
1、具体步骤
1.1、配置pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
<!-- spring boot web-->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- swagger-spring-boot -->
<dependency>
&l