# RuleDateQuery.java

    package cloud.wconnect.rateshop.pojo.query.revenue;

    import jakarta.validation.constraints.NotNull;
    import jakarta.validation.constraints.Pattern;
    import lombok.Data;
    import org.hibernate.validator.constraints.Range;

    /**
     * Query: Rule Date
     *
     * @author: yyt
     * 2025-07-07
     */
    @Data
    public class RuleDateQuery {

        /**
         * 日期
         */
        @NotNull(message = "the date is required")
        @Pattern(regexp = "^\\d{4}\\d{2}\\d{2}$", message = "The date format is incorrect, right format is [yyyyMMdd]")
        private String date;

        /**
         * 类型（1、去年同期，2、来年同期）
         */
        @NotNull(message = "the type is required")
        @Range(min = 1, max = 2, message = "the type must in [1:The same period last year, 2:The same period next year]")
        private Integer type;

        public static final int TYPE_LAST_YEAR = 1;

    }