1、在springboot中使用swagger的话,首先在pom文件中引入依赖
<!-- 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>
2、创建配置类

@Configuration
@EnableSwagger2
public class Swagger2Config{ @Bean
public Docket swaggerSpringMvcPlugin(){
return new Docket(DocunmentationType.Swagger_2).select().apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)).build();
  } }

3、在controller类上加Api注解

 


最新文章

  1. Python中的threading
  2. [JS7] 显示从0到99的100个数字
  3. MyEclipse8.6中提交SVN报错
  4. Lambda表达式【转】
  5. 搭建scala开发环境
  6. poj 2441 Arrange the Bulls(状态压缩dp)
  7. 老李分享:接口测试之jmeter
  8. bootstrap快速入门笔记(三)响应式,行,列,偏移量,排序
  9. 解决NSURLConnection finished with error - code -1100错误
  10. Python学习笔记 - 切片
  11. 7 Servlet 会话技术
  12. Leetcode: Find Permutation(Unsolve lock problem)
  13. CEBX格式的文档如何转换为PDF格式文档、DOCX文档?
  14. js方法参数中含有单引号双引号的处理
  15. Linux网络 - 数据包的接收过程【转】
  16. VS2015 将*.xaml.cs文件包裹在*.xaml文件下
  17. Nginx网站实现ssl安全套接字
  18. 微信小程序---分包加载(subpackages)及报错
  19. 关于Git的总结
  20. MUI class=&quot;mui-switch&quot; 开关 默认为选中

热门文章

  1. ASP.NET MVC视图
  2. Delphi访问活动目录(使用COM,活动目录Active Directory是用于Windows Server的目录服务)
  3. 手机控制PPT good
  4. 11g Oracle导出表 默认不导出数据为空的表解决
  5. java基础(1)-几种获取类的扩展方式
  6. 不一样的go语言-玩转语法之二
  7. U盘刻录kali linux启动盘提示找不到镜像解决方案
  8. Spring Boot 教程
  9. Python基础(八) 模块的引入与定义
  10. 微信小程序在ios下Echarts图表不能滑动的解决方案