Java中request请求配置
@Api("主键请求")
public class IdRequest {
@NotNull(message = "请检查参数,参数为空")
private Integer id;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
@Api("分页请求体")
public class PageRequest {
@ApiModelProperty("页码")
@NotNull(message = "请求页码不能为空")
@Min(value = 1,message = "请求页码不能小于1")
private Integer page;
@ApiModelProperty("页码大小")
@NotNull(message = "请求页码大小不能为空")
@Min(value = 1,message = "请求页码大小不能小于1")
private Integer size;
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
}
java中把request的基本信息都封装了。有点意思。