bob

Results 3 comments of bob

@AdnanHodzic dear Mr.AdnanHodzic: i'm interesting it, but with few skills, where can i got the detailed notes to read this code better? i wish i can be a of this...

我觉得你的拦截器还是有问题的: 1、没有看见那里使用了mybatisplugin插件,或许需要在项目中手动添加到sqlsessionfactory中 2、加密的时候不应该拦截sql构建周期,而应该拦截Executor的query周期和ParameterHandler的setParamenter周期, 还有你解析参数未免写的太过简单 BoundSql boundSql = (BoundSql)metaObject.getValue(BOUND_SQL); Object params = boundSql.getParameterObject(); if(params instanceof Map){ return invocation.proceed(); } SensitiveEncryptEnabled sensitiveEncryptEnabled = params != null ? params.getClass().getAnnotation(SensitiveEncryptEnabled.class) : null; 如果别人传的是一个实例对象那岂不是不能把参数加密了,未免不太符合场景了,mybatis里面的类型需要依据具体情况来讨论