2020-04-01 Swagger注解整理 未完待续

1.bean作为参数

@ApiModel(value="商城购物车", description="商城购物车")

2.bean字段

隐藏字段hidden = true

@ApiModelProperty(value="创建时间", required=false, hidden = true)

必填字段required=true

@ApiModelProperty(value = "用户ID", required=true)

3.controller的方法和参数

@ApiOperation(value = "根据规格ID,获取商品规格", notes = "根据规格ID,获取商品规格")

一个参数

@ApiImplicitParam(name = "id", value = "商品规格id", required = true, dataType = "String")

多参数

@ApiImplicitParams({

            @ApiImplicitParam(name = "id", value = "商品规格id"),

    @ApiImplicitParam(name = "name", value = "商品规格name"),

    })

4.controller描述

@Api(tags = "商城商品规格管理"

你可能感兴趣的:(2020-04-01 Swagger注解整理 未完待续)