swagger2注解

swagger2注解

注解 解释
@Api(value = "用户资源",description = "用户资源控制器") Controller
@ApiOperation(value = "注册功能",notes = "其实就是新增用户") 方法上
@ApiImplicitParams({
@ApiImplicitParam(value = "昵称",name = "nickName",dataType = "String",required = true),
@ApiImplicitParam(value = "邮箱",name = "email",dataType = "String",required = true),
@ApiImplicitParam(value = "密码",name = "password",dataType = "String",required = true)

})
参数
@ApiModel(description= "返回响应数据") model
@ApiModelProperty(value = "是否成功" model 属性
@ApiResponses({
@ApiResponse(code=200,message="用户注册成功")
})
返回
@ApiIgnore 不想显示
上一篇:django添加检查用户名和手机号数量接口


下一篇:django添加检查用户名和手机号数量接口