<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
3、启动类中添加@EnableSwagger2注解
@RestController
public class HelloController {
@GetMapping("/get")
public String get() {
return "get";
}
@PostMapping("/post")
public String post() {
return "post";
}
@RequestMapping("/hello")
public String hello() {
return "hello";
}
}
5、启动项目,并在浏览器输入http://localhost:8080/swagger-ui.html进行swagger-ui界面访问
友情链接 | 关于我们 | 下载帮助(?) | 联系我们 | 投诉举报
CopyRight © 2010-2023 这里下载 heredown.com , All Rights Reserved 版权所有 蒙ICP备2023006002号-1 蒙公网安备15052402000135
声明: 本站所有软件和文章来自互联网 如有异议 请与本站联系
声明: