docs: 注释优化
This commit is contained in:
@@ -1,19 +1,26 @@
|
||||
package com.youlai.boot.common.annotation;
|
||||
|
||||
|
||||
import com.youlai.boot.core.validator.FieldValidator;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 用于验证字段值是否合法的注解
|
||||
*
|
||||
* @author Ray.Hao
|
||||
* @since 2.18.0
|
||||
*/
|
||||
@Documented
|
||||
@Constraint(validatedBy = FieldValidator.class)
|
||||
@Target({ElementType.FIELD, ElementType.PARAMETER})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ValidField {
|
||||
|
||||
|
||||
/**
|
||||
* 验证失败时的错误信息。
|
||||
*/
|
||||
String message() default "非法字段";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
@@ -21,7 +28,7 @@ public @interface ValidField {
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
/**
|
||||
* 允许的字段值
|
||||
* 允许的合法值列表。
|
||||
*/
|
||||
String[] allowedValues();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user