修复获取分页总数异常

This commit is contained in:
2026-04-29 16:20:22 +08:00
parent ea4e797419
commit 143017bdc7

View File

@@ -7,6 +7,7 @@ import xtools.core.extend.PagingUtils;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* <p>Title : PageResp</p> * <p>Title : PageResp</p>
@@ -81,6 +82,9 @@ public final class PageResp<T> implements Serializable {
* @return 总页数 * @return 总页数
*/ */
public Long getPageCount() { public Long getPageCount() {
return PagingUtils.getLastPage(this.total, this.pageSize); if (Objects.isNull(this.pageCount)) {
this.pageCount = PagingUtils.getLastPage(this.total, this.pageSize);
}
return this.pageCount;
} }
} }