Merge branch 'feature/REQ-2545' into test

This commit is contained in:
lilong 2024-06-18 16:51:49 +08:00
commit 5272e410c1

View File

@ -25,4 +25,22 @@ public class PageResp<T> {
public List<T> getData() {
return Optional.ofNullable(data).orElse(ImmutableList.of());
}
public boolean hasNext() {
return this.current < this.getPages();
}
public long getPages() {
if (this.getSize() == 0L) {
return 0L;
}
long pages = this.getTotal() / this.getSize();
if (this.getTotal() % this.getSize() != 0L) {
++pages;
}
return pages;
}
}