| | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.executor.parameter.ParameterHandler; |
| | | import org.apache.ibatis.plugin.Interceptor; |
| | | import org.apache.ibatis.plugin.Intercepts; |
| | | import org.apache.ibatis.plugin.Invocation; |
| | | import org.apache.ibatis.plugin.Signature; |
| | | import org.apache.ibatis.plugin.*; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.encrypt.annotation.EncryptField; |
| | | import org.dromara.common.encrypt.core.EncryptContext; |
| | |
| | | this.encryptHandler(parameterObject); |
| | | } |
| | | } |
| | | return target; |
| | | return Plugin.wrap(target, this); |
| | | } |
| | | |
| | | /** |
| | |
| | | list.forEach(this::encryptHandler); |
| | | return; |
| | | } |
| | | // 不在缓存中的类,就是没有加密注解的类(当然也有可能是typeAliasesPackage写错) |
| | | Set<Field> fields = encryptorManager.getFieldCache(sourceObject.getClass()); |
| | | if(ObjectUtil.isNull(fields)){ |
| | | return; |
| | | } |
| | | try { |
| | | for (Field field : fields) { |
| | | field.set(sourceObject, this.encryptField(Convert.toStr(field.get(sourceObject)), field)); |