From 2094122bf645f9524b3641da27267f84f090bd8b Mon Sep 17 00:00:00 2001 From: TanYibin <5491541@qq.com> Date: Fri, 10 Jan 2025 10:02:34 +0800 Subject: [PATCH] 格式化代码 --- huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/DesensitizationResultSetInterceptor.java | 19 +++++++++---------- huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/MyBatisUpdateInterceptor.java | 8 ++------ huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysThirdAccount.java | 6 +++--- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/DesensitizationResultSetInterceptor.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/DesensitizationResultSetInterceptor.java index 0c93dac..538312f 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/DesensitizationResultSetInterceptor.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/DesensitizationResultSetInterceptor.java @@ -16,9 +16,7 @@ import java.lang.reflect.Field; import java.util.*; import java.util.concurrent.ConcurrentHashMap; -@Intercepts({ - @Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {Statement.class}) -}) +@Intercepts({@Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {Statement.class})}) public class DesensitizationResultSetInterceptor implements Interceptor { private static final Logger log = LoggerFactory.getLogger(DesensitizationResultSetInterceptor.class); @@ -31,7 +29,7 @@ public class DesensitizationResultSetInterceptor implements Interceptor { // 仅对查询结果集进行脱敏处理 if (result instanceof List) { - List<?> results = (List<?>) result; + List<?> results = (List<?>)result; for (Object object : results) { process(object); } @@ -39,6 +37,7 @@ public class DesensitizationResultSetInterceptor implements Interceptor { return result; } + @SuppressWarnings("unchecked") private void process(Object object) throws Throwable { if (object != null) { Class<?> handlerKey = object.getClass(); @@ -48,10 +47,8 @@ public class DesensitizationResultSetInterceptor implements Interceptor { handlerList = handlerMap.get(handlerKey); if (handlerList == null) { handlerList = new ArrayList<>(); - Set<Field> allFields = ReflectionUtils.getAllFields( - object.getClass(), - input -> input != null && input.getAnnotation(SensitiveField.class) != null - ); + Set<Field> allFields = + ReflectionUtils.getAllFields(object.getClass(), input -> input != null && input.getAnnotation(SensitiveField.class) != null); for (Field field : allFields) { handlerList.add(new Handler(field)); } @@ -71,13 +68,15 @@ public class DesensitizationResultSetInterceptor implements Interceptor { } @Override - public void setProperties(Properties properties) { - } + public void setProperties(Properties properties) {} private static class Handler { private final Field field; + private final SensitiveTypeEnums typeEnums; + private final String fillValue; + private final SensitiveStrategy sensitiveStrategy; Handler(Field field) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/MyBatisUpdateInterceptor.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/MyBatisUpdateInterceptor.java index 1818c86..59513c0 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/MyBatisUpdateInterceptor.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/MyBatisUpdateInterceptor.java @@ -10,12 +10,9 @@ import org.springframework.stereotype.Service; import java.util.Properties; -@Intercepts({ - @Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class}) -}) +@Intercepts({@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})}) public class MyBatisUpdateInterceptor implements Interceptor { - private static final Logger log = LoggerFactory.getLogger(MyBatisUpdateInterceptor.class); @Override @@ -30,6 +27,5 @@ public class MyBatisUpdateInterceptor implements Interceptor { } @Override - public void setProperties(Properties properties) { - } + public void setProperties(Properties properties) {} } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysThirdAccount.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysThirdAccount.java index 2128de4..a938c4f 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysThirdAccount.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysThirdAccount.java @@ -54,9 +54,9 @@ public class SysThirdAccount { @Excel(name = "真实姓名", width = 15) @ApiModelProperty(value = "真实姓名") private java.lang.String realname; - /** 真实姓名 */ - @Excel(name = "真实姓名", width = 15) - @ApiModelProperty(value = "真实姓名") + /** 第三方账户ID */ + @Excel(name = "第三方账户ID", width = 15) + @ApiModelProperty(value = "第三方账户ID") private java.lang.String thirdUserUuid; /** 真实姓名 */ @Excel(name = "第三方用户账号", width = 15) -- libgit2 0.22.2