package cn.iocoder.yudao.framework.common.model;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * 功能描述: todo
 * <p>
 * 作者: July
 * 日期: 2020-09-16 18:27
 * @author Administrator
 */
@Getter
@Setter
public class PageSearch {
    /** 页索引 */
    @NotNull(message = "不允许为空")
    @Min(value = 1, message = "最小值为: {value}")
    private int page = 1;

    /** 每页显示数量 */
    @NotNull(message = "不允许为空")
    @Min(value = 1, message = "最小值为: {value}")
    private int rows = 10;

    private Map<String, Object> entity;

    public int getRows() {
        if (rows > 100) { rows = 100; }
        return rows;
    }
}
