package com.cm.common.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Map;

/**
 * 列表分页
 *
 * @author wenc
 */
public class ListPage {

    private int page = 1;
    private long total;
    private int rows = 20;
    private Map<String, Object> params;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"page\":")
                .append(page);
        sb.append(",\"total\":")
                .append(total);
        sb.append(",\"rows\":")
                .append(rows);
        sb.append(",\"params\":")
                .append(params);
        sb.append('}');
        return sb.toString();
    }
}
