package com.mcwl.common.interfaces; import com.mcwl.common.valid.PhoneValidator; import javax.validation.Constraint; import javax.validation.Payload; import java.lang.annotation.*; /** * @author 苏三 * @date 2024/9/24 下午3:09 */ @Documented @Constraint(validatedBy = {PhoneValidator.class}) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidPhone { /** * 返回信息 */ String message() default "手机号码格式不正确"; /** * 分组 * @return */ Class[] groups() default {}; Class[] payload() default {}; }