houzhongyi
2024-07-11 e7c1260db32209a078a962aaa0ad5492c35774fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.iailab.framework.desensitize.core.slider.annotation;
 
import com.iailab.framework.desensitize.core.base.annotation.DesensitizeBy;
import com.iailab.framework.desensitize.core.slider.handler.MobileDesensitization;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
 
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
 
/**
 * 手机号
 *
 * @author gaibu
 */
@Documented
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@DesensitizeBy(handler = MobileDesensitization.class)
public @interface MobileDesensitize {
 
    /**
     * 前缀保留长度
     */
    int prefixKeep() default 3;
 
    /**
     * 后缀保留长度
     */
    int suffixKeep() default 4;
 
    /**
     * 替换规则,手机号;比如:13248765917 脱敏之后为 132****5917
     */
    String replacer() default "*";
 
}