upd: 规范格式
This commit is contained in:
parent
3a0a233f6a
commit
18a02ef74f
|
@ -1,12 +1,19 @@
|
||||||
package cn.odboy.infra.validate;
|
package cn.odboy.infra.validate;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
import javax.validation.Constraint;
|
import javax.validation.Constraint;
|
||||||
import javax.validation.Payload;
|
import javax.validation.Payload;
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
@Documented
|
@Documented
|
||||||
@Constraint(validatedBy = {MobileValidator.class})
|
@Constraint(validatedBy = {MobileValidator.class})
|
||||||
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
|
@Target({
|
||||||
|
ElementType.METHOD,
|
||||||
|
ElementType.FIELD,
|
||||||
|
ElementType.ANNOTATION_TYPE,
|
||||||
|
ElementType.CONSTRUCTOR,
|
||||||
|
ElementType.PARAMETER,
|
||||||
|
ElementType.TYPE_USE
|
||||||
|
})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Mobile {
|
public @interface Mobile {
|
||||||
boolean required() default false;
|
boolean required() default false;
|
||||||
|
|
|
@ -3,7 +3,6 @@ package cn.odboy.infra.validate;
|
||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.odboy.constant.RegexConst;
|
import cn.odboy.constant.RegexConst;
|
||||||
|
|
||||||
import javax.validation.ConstraintValidator;
|
import javax.validation.ConstraintValidator;
|
||||||
import javax.validation.ConstraintValidatorContext;
|
import javax.validation.ConstraintValidatorContext;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
package cn.odboy.infra.validate;
|
package cn.odboy.infra.validate;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
import javax.validation.Constraint;
|
import javax.validation.Constraint;
|
||||||
import javax.validation.Payload;
|
import javax.validation.Payload;
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
@Documented
|
@Documented
|
||||||
@Constraint(validatedBy = {NotEmptyListValidator.class})
|
@Constraint(validatedBy = {NotEmptyListValidator.class})
|
||||||
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
|
@Target({
|
||||||
|
ElementType.METHOD,
|
||||||
|
ElementType.FIELD,
|
||||||
|
ElementType.ANNOTATION_TYPE,
|
||||||
|
ElementType.CONSTRUCTOR,
|
||||||
|
ElementType.PARAMETER,
|
||||||
|
ElementType.TYPE_USE
|
||||||
|
})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface NotEmptyList {
|
public @interface NotEmptyList {
|
||||||
boolean required() default false;
|
boolean required() default false;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package cn.odboy.infra.validate;
|
package cn.odboy.infra.validate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import javax.validation.ConstraintValidator;
|
import javax.validation.ConstraintValidator;
|
||||||
import javax.validation.ConstraintValidatorContext;
|
import javax.validation.ConstraintValidatorContext;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验列表长度
|
* 校验列表长度
|
||||||
|
|
Loading…
Reference in New Issue