zoukankan      html  css  js  c++  java
  • pageVo工具类

    import java.util.Date;
    import java.util.List;
    
    public class PageVo<T> {
    
        private Integer code = 200;   //接口状态码
    
        // 当前页
        private Integer currentPage = 1;
        // 每页显示的总条数
        private Integer pageSize = 10;
        // 总条数
        private Integer totalNum;
        // 是否有下一页
        private Integer isMore;
        // 总页数
        private Integer totalPage;
        // 开始索引
        private Integer startIndex;
        // 分页结果
        private List<T> items;
    
        public PageVo() {
            super();
        }
    
        public PageVo(Integer currentPage, Integer pageSize, Integer totalNum) {
            super();
            if (currentPage != null && currentPage > 0) {
                this.currentPage = currentPage;
            }
            if (pageSize != null && pageSize > 0) {
                this.pageSize = pageSize;
            }
            this.totalNum = totalNum;
            this.totalPage = (this.totalNum + this.pageSize - 1) / this.pageSize;
            this.startIndex = (this.currentPage - 1) * this.pageSize;
            this.isMore = this.currentPage >= this.totalPage ? 0 : 1;
        }
    
        public Integer getCurrentPage() {
            return currentPage;
        }
    
        public void setCurrentPage(Integer currentPage) {
            this.currentPage = currentPage;
        }
    
        public Integer getPageSize() {
            return pageSize;
        }
    
        public void setPageSize(Integer pageSize) {
            this.pageSize = pageSize;
        }
    
        public Integer getTotalNum() {
            return totalNum;
        }
    
        public void setTotalNum(Integer totalNum) {
            this.totalNum = totalNum;
        }
    
        public Integer getIsMore() {
            return isMore;
        }
    
        public void setIsMore(Integer isMore) {
            this.isMore = isMore;
        }
    
        public Integer getTotalPage() {
            return totalPage;
        }
    
        public void setTotalPage(Integer totalPage) {
            this.totalPage = totalPage;
        }
    
        public Integer getStartIndex() {
            return startIndex;
        }
    
        public void setStartIndex(Integer startIndex) {
            this.startIndex = startIndex;
        }
    
        public List<T> getItems() {
            return items;
        }
    
        public void setItems(List<T> items) {
            this.items = items;
        }
    
        public Integer getCode() {
            return code;
        }
    
        public void setCode(Integer code) {
            this.code = code;
        }
    
    }
  • 相关阅读:
    [CodeForces]Codeforces Round #429 (Div. 2) ABC(待补)
    About Me
    2018-06-14
    Codeforces Codeforces Round #484 (Div. 2) E. Billiard
    Codeforces Codeforces Round #484 (Div. 2) D. Shark
    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings
    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes
    Codeforces Avito Code Challenge 2018 D. Bookshelves
    Codeforces Round #485 (Div. 2) D. Fair
    Codeforces Round #485 (Div. 2) F. AND Graph
  • 原文地址:https://www.cnblogs.com/woshuyuqiang/p/9742198.html
Copyright © 2011-2022 走看看