package com.gkhy.safePlatform.commons.vo;
|
|
import com.gkhy.safePlatform.commons.enums.ResultCodes;
|
|
public class
|
SearchResultVO<T> extends ResultVO<T>{
|
|
private boolean usePage;
|
|
private Long total;
|
|
private Long pages;
|
|
private Long pageSize;
|
|
private Long pageIndex;
|
|
|
public SearchResultVO() {
|
}
|
|
public SearchResultVO(ResultCodes rcode) {
|
this.code = rcode.getCode();
|
this.setCount(0);
|
this.setTotal(0L);
|
if(this.msg == null || this.msg.isEmpty()){
|
this.msg = rcode.getDesc();
|
}
|
this.usePage = false;
|
this.setPageSize(10L);
|
this.setPageIndex(1L);
|
this.setTotal(0L);
|
}
|
|
public static SearchResultVO success(){
|
SearchResultVO searchResultVO = new SearchResultVO();
|
searchResultVO.setCode(ResultCodes.OK.getCode());
|
return searchResultVO;
|
}
|
|
public SearchResultVO(boolean usePage,Long pageIndex, Long pageSize,Long pages, Long total ,T data,ResultCodes resultCode) {
|
super(resultCode, data);
|
this.usePage = usePage;
|
this.total = total;
|
this.pages = pages;
|
this.pageSize = pageSize;
|
this.pageIndex = pageIndex;
|
}
|
|
|
|
|
public boolean isUsePage() {
|
return usePage;
|
}
|
|
public void setUsePage(boolean usePage) {
|
this.usePage = usePage;
|
}
|
|
public Long getTotal() {
|
return total;
|
}
|
|
public void setTotal(Long total) {
|
this.total = total;
|
}
|
|
public Long getPageSize() {
|
return pageSize;
|
}
|
|
public void setPageSize(Long pageSize) {
|
this.pageSize = pageSize;
|
}
|
|
public Long getPageIndex() {
|
return pageIndex;
|
}
|
|
public void setPageIndex(Long pageIndex) {
|
this.pageIndex = pageIndex;
|
}
|
|
public Long getPages() {
|
return pages;
|
}
|
|
public void setPages(Long pages) {
|
this.pages = pages;
|
}
|
}
|