com.gccloud.starter.common.validator.module.user.Phone Maven / Gradle / Ivy
package com.gccloud.starter.common.validator.module.user;
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;
/**
* 联系方式校验
*
* @author liuchengbiao
* @date 2021年03月02日13:41:23
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = PhoneValidator.class)
public @interface Phone {
String message() default "手机号格式不正确";
Class>[] groups() default {};
Class extends Payload>[] payload() default {};
}