package com.ssm.manage.query;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;

/**
 * 临时工异常打卡记录页面查询对象
 */
@Getter
@Setter
@NoArgsConstructor
public class AbnormalClockInRecordPageQuery extends AbnormalClockInRecordQuery {
    /**
     * 默认页码
     */
    public static final int DEFAULT_PAGE = 1;
    public static final int DEFAULT_SIZE = 10;

    private int page = DEFAULT_PAGE;
    private int size = DEFAULT_SIZE;

    public AbnormalClockInRecordPageQuery(@NotNull AbnormalClockInRecordQuery query, Integer page, Integer size) {
        BeanUtils.copyProperties(query, this);
        this.page = page == null || page <= 0 ? DEFAULT_PAGE : page;
        this.size = size == null || size <= 0 ? DEFAULT_SIZE : size;
    }

}
