【7.3.3】包装器优化

pull/48/head
ye_star 2023-02-27 14:51:31 +08:00
parent 2eca3b47ed
commit 2438d8a830
1 changed files with 2 additions and 1 deletions

View File

@ -202,13 +202,14 @@ public class WrapperAop {
private Map<String, Object> wrapPureObject(Object originModel, Class<? extends BaseWrapper<?>>[] baseWrapperClasses) {
// 首先将原始的对象转化为map
Map<String, Object> originMap = BeanUtil.beanToMap(originModel);
Map<String, Object> originMap = null;
// 经过多个包装类填充属性
try {
for (Class<? extends BaseWrapper<?>> baseWrapperClass : baseWrapperClasses) {
BaseWrapper baseWrapper = baseWrapperClass.newInstance();
Map<String, Object> incrementFieldsMap = baseWrapper.doWrap(originModel);
originMap = BeanUtil.beanToMap(originModel);
originMap.putAll(incrementFieldsMap);
}
} catch (Exception e) {