美文网首页
springboot-swagger

springboot-swagger

作者: zxy_3197 | 来源:发表于2019-02-21 15:09 被阅读0次

1.pom.xml配置
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
2.application.yml配置
swagger:
basePackage: com.example.demo.controller
contact: com.example.demo
title: API list
version: 1.0
3.主程序需要添加@EnableSwagger2注解
4.controller示例
@ApiOperation(value = "addAccount", httpMethod = "GET", response = Date.class, notes = "添加用户账号")
@RequestMapping(value = "getuser",method = RequestMethod.GET)
public Integer getUser() {
String keys = redisService.get("WECHAT:CUSTOMIZE:MENU:VERSION",String.class);
System.out.println(keys);
Integer userById = userService.getUserById();
return userById;
}

相关文章

  • springboot-swagger

    springboot-swagger 首先说下swagger是个什么东西。 Swagger是一种Rest API的...

  • springboot-swagger

    喜欢Swagger,就是在前后端分离中,可以及时的在线同步更新api文档,方便自己进行功能测试,当然这是只是强大的...

  • springboot-swagger

    1.pom.xml配置io.springfox sp...

  • springboot-swagger报错

    一、具体步骤: 1.1、pom.xml,引入springfox-swagger2和springfox-swagge...

  • springboot-swagger实战浅析

    接口管理的强大工具。demo地址在文章最后 项目现在前后端分离,需要一个API的管理工具,在分析了如下几个最终选择...

网友评论

      本文标题:springboot-swagger

      本文链接:https://www.haomeiwen.com/subject/zobryqtx.html