package com.quinn.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class MyPageParam {

    public MyPageParam(int current, int size) {
        this.current = current;
        this.size = size;
        this.pageNum = (current - 1) * size;
    }

    @ApiModelProperty(value = "页码")
    private int current;

    @ApiModelProperty(value = "个数")
    private int size;

    @ApiModelProperty(value = "从哪个开始")
    private int pageNum;

    @ApiModelProperty(value = "总量")
    private int total;

    @ApiModelProperty(value = "总量")
    private int allTotal;

    public boolean hasPrevious(){
        return current > 1;
    }

    public boolean hasNext(){
        return total > (current * size);
    }



}
