yangys
2024-10-30 25db770e621f1259b8d5b7fd514207f7481c2d0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.qianwen.smartman.common.validator.phone;
 
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
 
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Constraint(validatedBy = {PhoneValueValidator.class})
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface PhoneValue {
 
    @Target({ElementType.FIELD, ElementType.PARAMETER})
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
    public @interface List {
        PhoneValue[] value();
    }
 
    String message() default "手机号码格式不正确";
 
    Class[] groups() default {};
 
    Class<? extends Payload>[] payload() default {};
 
    boolean required() default true;
}