From 0141c3ed55171b22dd998ba037166f67e69c9aa9 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期五, 19 四月 2024 22:22:14 +0800
Subject: [PATCH] 稼动率问题测试
---
smart-core-tool/src/main/java/com/qianwen/core/tool/senstive/SensitiveSerialize.java | 122 +++++++++++-----------------------------
1 files changed, 35 insertions(+), 87 deletions(-)
diff --git a/smart-core-tool/src/main/java/com/qianwen/core/tool/senstive/SensitiveSerialize.java b/smart-core-tool/src/main/java/com/qianwen/core/tool/senstive/SensitiveSerialize.java
index fefff3e..7f67e37 100644
--- a/smart-core-tool/src/main/java/com/qianwen/core/tool/senstive/SensitiveSerialize.java
+++ b/smart-core-tool/src/main/java/com/qianwen/core/tool/senstive/SensitiveSerialize.java
@@ -8,11 +8,8 @@
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
import java.io.IOException;
import java.util.Objects;
-import com.qianwen.core.tool.support.ImagePosition;
-import com.qianwen.core.tool.utils.CharPool;
import com.qianwen.core.tool.utils.DesensitizedUtils;
-/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/senstive/SensitiveSerialize.class */
public class SensitiveSerialize extends JsonSerializer<String> implements ContextualSerializer {
private SensitiveTypeEnum type;
private Integer prefixNoMaskLen;
@@ -29,91 +26,42 @@
this.maskStr = maskStr;
}
- /* JADX INFO: Access modifiers changed from: package-private */
- /* renamed from: org.springblade.core.tool.senstive.SensitiveSerialize$1 reason: invalid class name */
- /* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/senstive/SensitiveSerialize$1.class */
- public static /* synthetic */ class AnonymousClass1 {
- static final /* synthetic */ int[] $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum = new int[SensitiveTypeEnum.values().length];
-
- static {
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.CHINESE_NAME.ordinal()] = 1;
- } catch (NoSuchFieldError e) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.ID_CARD.ordinal()] = 2;
- } catch (NoSuchFieldError e2) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.FIXED_PHONE.ordinal()] = 3;
- } catch (NoSuchFieldError e3) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.MOBILE_PHONE.ordinal()] = 4;
- } catch (NoSuchFieldError e4) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.ADDRESS.ordinal()] = 5;
- } catch (NoSuchFieldError e5) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.EMAIL.ordinal()] = 6;
- } catch (NoSuchFieldError e6) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.BANK_CARD.ordinal()] = 7;
- } catch (NoSuchFieldError e7) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.PASSWORD.ordinal()] = 8;
- } catch (NoSuchFieldError e8) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.KEY.ordinal()] = 9;
- } catch (NoSuchFieldError e9) {
- }
- try {
- $SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[SensitiveTypeEnum.CUSTOMER.ordinal()] = 10;
- } catch (NoSuchFieldError e10) {
- }
- }
- }
-
public void serialize(final String origin, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException {
- switch (AnonymousClass1.$SwitchMap$org$springblade$core$tool$senstive$SensitiveTypeEnum[this.type.ordinal()]) {
- case 1:
- jsonGenerator.writeString(DesensitizedUtils.chineseName(origin));
- return;
- case ImagePosition.CENTER /* 2 */:
- jsonGenerator.writeString(DesensitizedUtils.idCardNum(origin));
- return;
- case 3:
- jsonGenerator.writeString(DesensitizedUtils.fixedPhone(origin));
- return;
- case ImagePosition.LEFT /* 4 */:
- jsonGenerator.writeString(DesensitizedUtils.mobilePhone(origin));
- return;
- case 5:
- jsonGenerator.writeString(DesensitizedUtils.address(origin));
- return;
- case 6:
- jsonGenerator.writeString(DesensitizedUtils.email(origin));
- return;
- case 7:
- jsonGenerator.writeString(DesensitizedUtils.bankCard(origin));
- return;
- case ImagePosition.BOTTOM /* 8 */:
- jsonGenerator.writeString(DesensitizedUtils.password(origin));
- return;
- case CharPool.TAB /* 9 */:
- jsonGenerator.writeString(DesensitizedUtils.key(origin));
- return;
- case CharPool.NEWLINE /* 10 */:
- jsonGenerator.writeString(DesensitizedUtils.desValue(origin, this.prefixNoMaskLen.intValue(), this.suffixNoMaskLen.intValue(), this.maskStr));
- return;
- default:
- throw new IllegalArgumentException("Unknow sensitive type enum " + this.type);
- }
+ switch (this.type) {
+ case CHINESE_NAME:
+ jsonGenerator.writeString(DesensitizedUtils.chineseName(origin));
+ return;
+ case ID_CARD:
+ jsonGenerator.writeString(DesensitizedUtils.idCardNum(origin));
+ return;
+ case FIXED_PHONE:
+ jsonGenerator.writeString(DesensitizedUtils.fixedPhone(origin));
+ return;
+ case MOBILE_PHONE:
+ jsonGenerator.writeString(DesensitizedUtils.mobilePhone(origin));
+ return;
+ case ADDRESS:
+ jsonGenerator.writeString(DesensitizedUtils.address(origin));
+ return;
+ case EMAIL:
+ jsonGenerator.writeString(DesensitizedUtils.email(origin));
+ return;
+ case BANK_CARD:
+ jsonGenerator.writeString(DesensitizedUtils.bankCard(origin));
+ return;
+ case PASSWORD:
+ jsonGenerator.writeString(DesensitizedUtils.password(origin));
+ return;
+ case KEY:
+ jsonGenerator.writeString(DesensitizedUtils.key(origin));
+ return;
+ case CUSTOMER:
+ jsonGenerator.writeString(DesensitizedUtils.desValue(origin, this.prefixNoMaskLen.intValue(),
+ this.suffixNoMaskLen.intValue(), this.maskStr));
+ return;
+ }
+ throw new IllegalArgumentException("Unknow sensitive type enum " + this.type);
+
}
public JsonSerializer<?> createContextual(final SerializerProvider serializerProvider, final BeanProperty beanProperty) throws JsonMappingException {
--
Gitblit v1.9.3