springboot整合swagger2的方法请阅读
一、controller上使用
@Api(value = "注册登陆",tags = {"用于登陆的相关接口"})
类名上的备注,主要用于展示整个类接口的分组描述。
@ApiIgnore
忽略生成api
@ApiOperation(value = "用户注册",notes = "用户注册",httpMethod = "POST")
方法上描述,该接口的左右及请求方式
@ApiModel(value = "用户注册对象",description = "客服端传来的数据封装")
@DATA
public class UserBO {
@ApiModelProperty(value = "用户名",name="username",example = "admin",required = true)
private String username;
@ApiModelProperty(value = "密码",name="password",example = "123456",required = true)
private String password;
@ApiModelProperty(value = "确认密码",name="confirmPassword",example = "123456",required = true)
private String confirmPassword;
}
接口参数封装类上的描述
整体效果: