记录swagger使用-version2.9
注解描述参考(版本可能不一致):
https://blog.csdn.net/Jack_EUSong/article/details/80349694
https://blog.csdn.net/u014231523/article/details/76522486
接口使用(接受实体类参数)
@Api(value = “当前类的描述”) //作用于类上
@ApiOperation(value = “当前方法名”,notes = “当前方法的描述”)
@ApiResponses(当前返回类中有code参数,描述code参数, response = void.class)
@Valid (spring mvc注解,做校验用,需配合参数中 BindingResult )
@PostMapping("/category_page_search")
@ApiOperation(value = "根据分类查询并分页",notes = "根据分类ID查询商品并分页")
@ApiResponses({
@ApiResponse(code = 500, message = "内部错误"),
@ApiResponse(code = 400, message = "参数错误"),
@ApiResponse(code = 204, message = "没有返回结果"),
@ApiResponse(code = 200, message = "成功", response = ApiResult.class)
})
@ApiImplicitParams({
@ApiImplicitParam(name = "cid",value = "分类ID",required = true,dataType = "int"),
@ApiImplicitParam(name = "page",value = "当前页",required = true,dataType = "int"),
@ApiImplicitParam(name = "limit",value = "每页最大数",required = true,dataType = "int"),
@ApiImplicitParam(name =