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