package com.ruoyi.ext.api.validate;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自定义时间字符串校验注解
 * rule规则   before时间之前   after时间之后   beforeAndNow时间现在或之前  afterAndNow时间现在或之后
 * @author ruoyi
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(value = { ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER })
@Constraint(validatedBy = { DateValidator.class })
public @interface DateV
{
    String message() default "日期时间不符合规范格式";

    String pattern() default "yyyyMMddHHmmss";

    String rule() default "";

    Class<?>[] groups() default { };
    Class<? extends Payload>[] payload() default { };
}


