This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package jnpf.annotation;
|
||||
|
||||
import jnpf.enums.SensitiveTypeEnum;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 脱敏注解
|
||||
*
|
||||
* @author wcx
|
||||
* @date 2024/2/3
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Sensitive {
|
||||
/**
|
||||
* 脱敏数据类型
|
||||
*/
|
||||
SensitiveTypeEnum type() default SensitiveTypeEnum.CUSTOMER;
|
||||
|
||||
/**
|
||||
* 前置不需要打码的长度
|
||||
*/
|
||||
int prefixNoMaskLen() default 0;
|
||||
|
||||
/**
|
||||
* 后置不需要打码的长度
|
||||
*/
|
||||
int suffixNoMaskLen() default 0;
|
||||
|
||||
/**
|
||||
* 用什么打码
|
||||
*/
|
||||
String symbol() default "*";
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package jnpf.annotation.check;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface CheckLength {
|
||||
|
||||
String message() default "non err";
|
||||
|
||||
int max();
|
||||
|
||||
int min() default 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package jnpf.annotation.check;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface CheckListSize {
|
||||
|
||||
String message();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package jnpf.annotation.check;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface CheckNull {
|
||||
|
||||
String message() default "non err";
|
||||
}
|
||||
Reference in New Issue
Block a user