refactor(core): TreeBuildUtils => TreeUtils

This commit is contained in:
2025-07-22 20:21:44 +08:00
parent 55660ba18b
commit c76d777a2e
3 changed files with 23 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.exception.BusinessException;
import top.continew.starter.core.util.ReflectUtils;
import top.continew.starter.core.util.TreeBuildUtils;
import top.continew.starter.core.util.TreeUtils;
import top.continew.starter.core.util.validation.ValidationUtils;
import top.continew.starter.data.base.BaseMapper;
import top.continew.starter.data.service.impl.ServiceImpl;
@@ -127,8 +127,8 @@ public class CrudServiceImpl<M extends BaseMapper<T>, T extends BaseIdDO, L, D,
Function<L, Long> getParentId = createMethodReference(listClass, CharSequenceUtil.genGetter(treeField
.parentIdKey()));
// 构建多根节点树
return TreeBuildUtils.buildMultiRoot(list, getId, getParentId, treeNodeConfig, (node,
tree) -> buildTreeField(isSimple, node, tree, treeField));
return TreeUtils.buildMultiRoot(list, getId, getParentId, treeNodeConfig, (node,
tree) -> buildTreeField(isSimple, node, tree, treeField));
}
}

View File

@@ -39,7 +39,7 @@ import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.exception.BusinessException;
import top.continew.starter.core.util.ClassUtils;
import top.continew.starter.core.util.ReflectUtils;
import top.continew.starter.core.util.TreeBuildUtils;
import top.continew.starter.core.util.TreeUtils;
import top.continew.starter.core.util.validation.CheckUtils;
import top.continew.starter.core.util.validation.ValidationUtils;
import top.continew.starter.data.mapper.BaseMapper;
@@ -132,8 +132,8 @@ public class CrudServiceImpl<M extends BaseMapper<T>, T extends BaseIdDO, L, D,
Function<L, Long> getParentId = createMethodReference(listClass, CharSequenceUtil.genGetter(treeField
.parentIdKey()));
// 构建多根节点树
return TreeBuildUtils.buildMultiRoot(list, getId, getParentId, treeNodeConfig, (node,
tree) -> buildTreeField(isSimple, node, tree, treeField));
return TreeUtils.buildMultiRoot(list, getId, getParentId, treeNodeConfig, (node,
tree) -> buildTreeField(isSimple, node, tree, treeField));
}
}