package com.face.global.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

public class PageRequestVO {
    @Getter
    @Setter
    @Min(value = 1)
    private int pageIndex;

    @Getter
    @Setter
    @Min(value = 1)
    @Max(value = 200)
    private int pageSize;

    @Getter
    @Setter
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createStartDate;

    @Getter
    @Setter
    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
    private Date createEndDate;

    private int start;

    public int getStart() {
        return (pageIndex - 1) * pageSize;
    }

    @Getter
    @Setter
    private String myUserId;

    @Getter
    @Setter
    private String myOrgId;
}
