Skip to content

Commit

Permalink
🎨 优化实现
Browse files Browse the repository at this point in the history
  • Loading branch information
fxbin committed Apr 5, 2023
1 parent e0a529e commit 552a753
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,7 @@ public PageResult<T> setPageSize(Long pageSize) {
}

public PageResult<T> compute(Integer pageSize, Integer pageNo, Long total) {
this.pageSize = Long.valueOf(pageSize);
this.pageNo = Long.valueOf(pageNo);
if (total > 0) {
this.total = total;

if (total % this.pageSize > 0) {
this.totalPage = (total / this.pageSize) + 1;
} else {
this.totalPage = (total / this.pageSize);
}
} else {
this.totalPage = 0L;
this.total = 0L;
}
return this;
return this.compute(pageSize.longValue(), pageNo.longValue(), total);
}

public PageResult<T> compute(Long pageSize, Long pageNo, Long total) {
Expand Down

0 comments on commit 552a753

Please sign in to comment.