提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.framework.common.validation; |
H |
2 |
|
|
3 |
import javax.validation.Constraint; |
|
4 |
import javax.validation.Payload; |
|
5 |
import java.lang.annotation.*; |
|
6 |
|
|
7 |
@Target({ |
|
8 |
ElementType.METHOD, |
|
9 |
ElementType.FIELD, |
|
10 |
ElementType.ANNOTATION_TYPE, |
|
11 |
ElementType.CONSTRUCTOR, |
|
12 |
ElementType.PARAMETER, |
|
13 |
ElementType.TYPE_USE |
|
14 |
}) |
|
15 |
@Retention(RetentionPolicy.RUNTIME) |
|
16 |
@Documented |
|
17 |
@Constraint( |
|
18 |
validatedBy = MobileValidator.class |
|
19 |
) |
|
20 |
public @interface Mobile { |
|
21 |
|
|
22 |
String message() default "手机号格式不正确"; |
|
23 |
|
|
24 |
Class<?>[] groups() default {}; |
|
25 |
|
|
26 |
Class<? extends Payload>[] payload() default {}; |
|
27 |
|
|
28 |
} |