package top.baogutang.common.domain;

import lombok.Data;

import java.io.Serializable;

/**
 * @description:
 * @author: nikooh
 * @date: 2024/02/22 : 11:22
 */
@Data
public class PageParam implements Serializable {

    private static final long serialVersionUID = 5353838683455028860L;

    private Integer pageNum;

    private Integer pageSize;

    public Integer getPageNum() {
        pageNum = pageNum == null ? 1 : pageNum;
        return pageNum;
    }

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

    public Integer getPageSize() {
        if (pageSize == null || pageSize > 100) {
            pageSize = 10;
        }
        return pageSize;
    }

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

}
