package com.backendsys.utils.v2;

import cn.hutool.core.util.StrUtil;

/**
 * 分页数据
 */
public class PageDomain {
    private Integer page_num;               // 当前记录起始索引
    private Integer page_size;              // 每页显示记录数
    private String order_by_column;         // 排序列 (默认升序)
    private String is_asc = "asc";          // 排序的方向desc或者asc
    private Boolean reasonable = true;      // 分页参数合理化

    public String getOrderBy() {
        if (StrUtil.isEmpty(order_by_column)) return "";
        return StrUtil.toUnderlineCase(order_by_column) + " " + is_asc;
    }

    public Integer getPageNum() {
        return page_num;
    }

    public void setPageNum(Integer page_num) {
        this.page_num = page_num;
    }

    public Integer getPageSize() {
        return page_size;
    }

    public void setPageSize(Integer page_size) {
        this.page_size = page_size;
    }

    public String getOrderByColumn() {
        return order_by_column;
    }

    public void setOrderByColumn(String order_by_column) {
        this.order_by_column = order_by_column;
    }

    public String getIsAsc() {
        return is_asc;
    }

    public void setIsAsc(String isAsc) {
        this.is_asc = is_asc;
    }

    public Boolean getReasonable() {
        return reasonable;
    }

    public void setReasonable(Boolean reasonable) {
        this.reasonable = reasonable;
    }
}
