mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-03-14 18:02:01 +08:00
update 更新 统一枚举相关包名为enums
This commit is contained in:
@@ -1,48 +1,48 @@
|
||||
package org.dromara.common.core.validate.enumd;
|
||||
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* 自定义枚举校验
|
||||
*
|
||||
* @author 秋辞未寒
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
@Documented
|
||||
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
|
||||
@Retention(RUNTIME)
|
||||
@Repeatable(EnumPattern.List.class) // 允许在同一元素上多次使用该注解
|
||||
@Constraint(validatedBy = {EnumPatternValidator.class})
|
||||
public @interface EnumPattern {
|
||||
|
||||
/**
|
||||
* 需要校验的枚举类型
|
||||
*/
|
||||
Class<? extends Enum<?>> type();
|
||||
|
||||
/**
|
||||
* 枚举类型校验值字段名称
|
||||
* 需确保该字段实现了 getter 方法
|
||||
*/
|
||||
String fieldName();
|
||||
|
||||
String message() default "输入值不在枚举范围内";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
@Documented
|
||||
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
|
||||
@Retention(RUNTIME)
|
||||
@interface List {
|
||||
EnumPattern[] value();
|
||||
}
|
||||
|
||||
}
|
||||
package org.dromara.common.core.validate.enums;
|
||||
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* 自定义枚举校验
|
||||
*
|
||||
* @author 秋辞未寒
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
@Documented
|
||||
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
|
||||
@Retention(RUNTIME)
|
||||
@Repeatable(EnumPattern.List.class) // 允许在同一元素上多次使用该注解
|
||||
@Constraint(validatedBy = {EnumPatternValidator.class})
|
||||
public @interface EnumPattern {
|
||||
|
||||
/**
|
||||
* 需要校验的枚举类型
|
||||
*/
|
||||
Class<? extends Enum<?>> type();
|
||||
|
||||
/**
|
||||
* 枚举类型校验值字段名称
|
||||
* 需确保该字段实现了 getter 方法
|
||||
*/
|
||||
String fieldName();
|
||||
|
||||
String message() default "输入值不在枚举范围内";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
@Documented
|
||||
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
|
||||
@Retention(RUNTIME)
|
||||
@interface List {
|
||||
EnumPattern[] value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.dromara.common.core.validate.enumd;
|
||||
package org.dromara.common.core.validate.enums;
|
||||
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.dromara.common.encrypt.annotation;
|
||||
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.dromara.common.encrypt.core;
|
||||
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.dromara.common.encrypt.core;
|
||||
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
|
||||
/**
|
||||
* 加解者
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.dromara.common.encrypt.core.encryptor;
|
||||
|
||||
import org.dromara.common.encrypt.core.EncryptContext;
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import org.dromara.common.encrypt.utils.EncryptUtils;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.dromara.common.encrypt.core.encryptor;
|
||||
|
||||
import org.dromara.common.encrypt.core.EncryptContext;
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import org.dromara.common.encrypt.utils.EncryptUtils;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.dromara.common.encrypt.core.encryptor;
|
||||
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.encrypt.core.EncryptContext;
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import org.dromara.common.encrypt.utils.EncryptUtils;
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.dromara.common.encrypt.core.encryptor;
|
||||
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.encrypt.core.EncryptContext;
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import org.dromara.common.encrypt.utils.EncryptUtils;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.dromara.common.encrypt.core.encryptor;
|
||||
|
||||
import org.dromara.common.encrypt.core.EncryptContext;
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import org.dromara.common.encrypt.utils.EncryptUtils;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.dromara.common.encrypt.enumd;
|
||||
package org.dromara.common.encrypt.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.dromara.common.encrypt.enumd;
|
||||
package org.dromara.common.encrypt.enums;
|
||||
|
||||
/**
|
||||
* 编码类型
|
||||
@@ -12,8 +12,8 @@ import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.encrypt.annotation.EncryptField;
|
||||
import org.dromara.common.encrypt.core.EncryptContext;
|
||||
import org.dromara.common.encrypt.core.EncryptorManager;
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import org.dromara.common.encrypt.properties.EncryptorProperties;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@@ -11,8 +11,8 @@ import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.encrypt.annotation.EncryptField;
|
||||
import org.dromara.common.encrypt.core.EncryptContext;
|
||||
import org.dromara.common.encrypt.core.EncryptorManager;
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import org.dromara.common.encrypt.properties.EncryptorProperties;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.dromara.common.encrypt.properties;
|
||||
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enumd.EncodeType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.EncodeType;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.dromara.demo.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import org.dromara.common.encrypt.annotation.EncryptField;
|
||||
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user