package com.changhu.common.validator.annotation;

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

import java.lang.annotation.*;

/**
 * author: luozhun
 * desc: IsMobile
 * createTime: 2023/8/22 9:38
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {IsMobileValidator.class})
public @interface IsMobile {
    boolean required() default true;

    String message() default "手机号码格式错误!";

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

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

