-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package com.xxl.tool.response; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
/** | ||
* page model | ||
* | ||
* @author xuxueli | ||
*/ | ||
public class PageModel<T> implements Serializable { | ||
public static final long serialVersionUID = 42L; | ||
|
||
/** | ||
* page no | ||
*/ | ||
private int pageNo; | ||
/** | ||
* page size | ||
*/ | ||
private int pageSize; | ||
/** | ||
* page data | ||
*/ | ||
private List<T> pageData; | ||
/** | ||
* total records | ||
*/ | ||
private int totalCount; | ||
|
||
/** | ||
* // tool | ||
* int totalPages = (int) Math.ceil((double) totalCount/pageSize); | ||
* int startIndex = (pageNo-1) * pageSize; | ||
* int endIndex = Math.min(startIndex + pageSize, totalCount); | ||
*/ | ||
|
||
public int getPageNo() { | ||
return pageNo; | ||
} | ||
|
||
public void setPageNo(int pageNo) { | ||
this.pageNo = pageNo; | ||
} | ||
|
||
public int getPageSize() { | ||
return pageSize; | ||
} | ||
|
||
public void setPageSize(int pageSize) { | ||
this.pageSize = pageSize; | ||
} | ||
|
||
public List<T> getPageData() { | ||
return pageData; | ||
} | ||
|
||
public void setPageData(List<T> pageData) { | ||
this.pageData = pageData; | ||
} | ||
|
||
public int getTotalCount() { | ||
return totalCount; | ||
} | ||
|
||
public void setTotalCount(int totalCount) { | ||
this.totalCount = totalCount; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PageModel{" + | ||
"pageNo=" + pageNo + | ||
", pageSize=" + pageSize + | ||
", pageData=" + pageData + | ||
", totalCount=" + totalCount + | ||
'}'; | ||
} | ||
|
||
} |