Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxueli committed Jul 13, 2024
1 parent f0aeeb0 commit 7dbd80e
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions src/main/java/com/xxl/tool/response/PageModel.java
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 +
'}';
}

}

0 comments on commit 7dbd80e

Please sign in to comment.