Commit 2094122bf645f9524b3641da27267f84f090bd8b
1 parent
7f6af09d
格式化代码
Signed-off-by: TanYibin <5491541@qq.com>
Showing
3 changed files
with
14 additions
and
19 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/DesensitizationResultSetInterceptor.java
... | ... | @@ -16,9 +16,7 @@ import java.lang.reflect.Field; |
16 | 16 | import java.util.*; |
17 | 17 | import java.util.concurrent.ConcurrentHashMap; |
18 | 18 | |
19 | -@Intercepts({ | |
20 | - @Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {Statement.class}) | |
21 | -}) | |
19 | +@Intercepts({@Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {Statement.class})}) | |
22 | 20 | public class DesensitizationResultSetInterceptor implements Interceptor { |
23 | 21 | |
24 | 22 | private static final Logger log = LoggerFactory.getLogger(DesensitizationResultSetInterceptor.class); |
... | ... | @@ -31,7 +29,7 @@ public class DesensitizationResultSetInterceptor implements Interceptor { |
31 | 29 | |
32 | 30 | // 仅对查询结果集进行脱敏处理 |
33 | 31 | if (result instanceof List) { |
34 | - List<?> results = (List<?>) result; | |
32 | + List<?> results = (List<?>)result; | |
35 | 33 | for (Object object : results) { |
36 | 34 | process(object); |
37 | 35 | } |
... | ... | @@ -39,6 +37,7 @@ public class DesensitizationResultSetInterceptor implements Interceptor { |
39 | 37 | return result; |
40 | 38 | } |
41 | 39 | |
40 | + @SuppressWarnings("unchecked") | |
42 | 41 | private void process(Object object) throws Throwable { |
43 | 42 | if (object != null) { |
44 | 43 | Class<?> handlerKey = object.getClass(); |
... | ... | @@ -48,10 +47,8 @@ public class DesensitizationResultSetInterceptor implements Interceptor { |
48 | 47 | handlerList = handlerMap.get(handlerKey); |
49 | 48 | if (handlerList == null) { |
50 | 49 | handlerList = new ArrayList<>(); |
51 | - Set<Field> allFields = ReflectionUtils.getAllFields( | |
52 | - object.getClass(), | |
53 | - input -> input != null && input.getAnnotation(SensitiveField.class) != null | |
54 | - ); | |
50 | + Set<Field> allFields = | |
51 | + ReflectionUtils.getAllFields(object.getClass(), input -> input != null && input.getAnnotation(SensitiveField.class) != null); | |
55 | 52 | for (Field field : allFields) { |
56 | 53 | handlerList.add(new Handler(field)); |
57 | 54 | } |
... | ... | @@ -71,13 +68,15 @@ public class DesensitizationResultSetInterceptor implements Interceptor { |
71 | 68 | } |
72 | 69 | |
73 | 70 | @Override |
74 | - public void setProperties(Properties properties) { | |
75 | - } | |
71 | + public void setProperties(Properties properties) {} | |
76 | 72 | |
77 | 73 | private static class Handler { |
78 | 74 | private final Field field; |
75 | + | |
79 | 76 | private final SensitiveTypeEnums typeEnums; |
77 | + | |
80 | 78 | private final String fillValue; |
79 | + | |
81 | 80 | private final SensitiveStrategy sensitiveStrategy; |
82 | 81 | |
83 | 82 | Handler(Field field) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/desensitization/plugin/MyBatisUpdateInterceptor.java
... | ... | @@ -10,12 +10,9 @@ import org.springframework.stereotype.Service; |
10 | 10 | |
11 | 11 | import java.util.Properties; |
12 | 12 | |
13 | -@Intercepts({ | |
14 | - @Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class}) | |
15 | -}) | |
13 | +@Intercepts({@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})}) | |
16 | 14 | public class MyBatisUpdateInterceptor implements Interceptor { |
17 | 15 | |
18 | - | |
19 | 16 | private static final Logger log = LoggerFactory.getLogger(MyBatisUpdateInterceptor.class); |
20 | 17 | |
21 | 18 | @Override |
... | ... | @@ -30,6 +27,5 @@ public class MyBatisUpdateInterceptor implements Interceptor { |
30 | 27 | } |
31 | 28 | |
32 | 29 | @Override |
33 | - public void setProperties(Properties properties) { | |
34 | - } | |
30 | + public void setProperties(Properties properties) {} | |
35 | 31 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysThirdAccount.java
... | ... | @@ -54,9 +54,9 @@ public class SysThirdAccount { |
54 | 54 | @Excel(name = "真实姓名", width = 15) |
55 | 55 | @ApiModelProperty(value = "真实姓名") |
56 | 56 | private java.lang.String realname; |
57 | - /** 真实姓名 */ | |
58 | - @Excel(name = "真实姓名", width = 15) | |
59 | - @ApiModelProperty(value = "真实姓名") | |
57 | + /** 第三方账户ID */ | |
58 | + @Excel(name = "第三方账户ID", width = 15) | |
59 | + @ApiModelProperty(value = "第三方账户ID") | |
60 | 60 | private java.lang.String thirdUserUuid; |
61 | 61 | /** 真实姓名 */ |
62 | 62 | @Excel(name = "第三方用户账号", width = 15) |
... | ... |