com.fengwenyi.apistarter.constraints.Phone Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-spring-boot-starter Show documentation
Show all versions of api-spring-boot-starter Show documentation
Spring Boot API Starter Project
package com.fengwenyi.apistarter.constraints;
import com.fengwenyi.apistarter.validator.PhoneValidator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
/**
* @author Erwin Feng
* @since 2021-08-09
*/
@Constraint(validatedBy = {PhoneValidator.class})
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
public @interface Phone {
String message() default "手机号码格式错误";
Class[] groups() default {};
Class[] payload() default {};
}