Pagination.java 443 B

12345678910111213141516171819202122232425262728293031
  1. package com.persagy.bdtp.adm.entity;
  2. import lombok.Data;
  3. /**
  4. * 调用服务时记录分页信息
  5. */
  6. @Data
  7. public class Pagination {
  8. private int pageNum = 1;
  9. private int pageSize;
  10. private int total = -1;
  11. private boolean hasNext = true;
  12. public Pagination(int pageSize) {
  13. this.pageSize = pageSize;
  14. }
  15. public void next() {
  16. pageNum++;
  17. if ((pageNum - 1) * pageSize >= total)
  18. hasNext = false;
  19. else
  20. hasNext = true;
  21. }
  22. }