package com.changhu.common.validator.annotation;

import com.changhu.common.validator.IdCardValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author 20252
 * @createTime 2024/8/21 下午3:34
 * @desc IdCard...
 */
@Documented
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Constraint(validatedBy = {IdCardValidator.class})
public @interface IdCard {
    boolean required() default true;

    String message() default "身份证格式错误!";

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

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