zoukankan      html  css  js  c++  java
  • springboot中swagger接口文档使用

    1.pom文件引用
      <dependency>
        <groupId>com.github.xiaoymin</groupId>
        <artifactId>swagger-bootstrap-ui</artifactId>
        <version>1.9.6</version>
      </dependency>

    2.注解:

      controller注解:

        //接口说明
        @ApiOperation(value = "查询商品分期数据")
        //接口参数
        @ApiImplicitParams({
          @ApiImplicitParam(value = "商品ids", name = "ids"),
        })
        //接口返回
        @ApiResponses({

          @ApiResponse(code = 0, message = "商品信息数组 siteProducts", response = SiteProduct.class)

         })

      entity注解:
        @ApiModelProperty(value = "分期数")
        private String periods;

    3.启动项目后,直接通过 /doc.html 地址查询接口信息

  • 相关阅读:
    对于global的介绍
    elang和python互通的例子
    gen_server的一些心得
    erlang分布式例子
    erlang热部署
    erlang配置三方库
    opencv学习之PyImageSearch
    雅克比矩阵
    罗德里格斯公式的证明
    opencv学习网站
  • 原文地址:https://www.cnblogs.com/smj1990/p/12012033.html
Copyright © 2011-2022 走看看