@Constraint 自定义注解校验手机号 自定义注解 /** * 手机号校验 * @author lkb * @date 2021/4/12 */ @Target({ ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @Constraint(validatedBy = { PhoneValidator.class}) public @interface PhoneValid { String message()