package com.estate.expert.admin.service;
|
|
import com.estate.expert.admin.domain.standard.hierachy.Hierarchy;
|
import com.estate.expert.admin.domain.standard.hierachy.HierarchyData;
|
import com.estate.expert.admin.domain.standard.hierachy.HierarchyDto;
|
import com.estate.expert.admin.service.common.CrudServiceBase;
|
import com.estate.expert.admin.utils.tree.TreeNode;
|
import com.estate.expert.admin.utils.tree.TreeRoot;
|
|
import java.util.List;
|
|
/**
|
* 体系服务
|
*/
|
public interface HierarchyService extends CrudServiceBase<Hierarchy, HierarchyDto> {
|
|
///// 常规方法 //////
|
/**
|
* 获取根节点
|
* @param id 体系ID
|
* @return 根节点
|
*/
|
TreeRoot<HierarchyData> root(Integer id);
|
|
/**
|
* 获取节点
|
* @param id 体系ID
|
* @param path 路径
|
* @param includeChildren 是否包含子节点
|
* @return 节点
|
*/
|
TreeNode<HierarchyData> node(Integer id, String path, boolean includeChildren);
|
|
/**
|
* 获取子节点
|
* @param id 体系ID
|
* @param path 路径
|
* @param keyword 关键词
|
* @return 子节点
|
*/
|
List<TreeNode<HierarchyData>> children(Integer id, String path, String keyword);
|
|
/**
|
* 编辑节点
|
* @param id 体系ID
|
* @param path 路径
|
* @param name 名称
|
* @param data 数据
|
*/
|
void edit(Integer id, String path, String name, HierarchyData data);
|
|
/**
|
* 添加子节点
|
* @param id 体系ID
|
* @param parentPath 父节点路径
|
* @param name 名称
|
* @param data 数据
|
* @return 子节点
|
*/
|
TreeNode<HierarchyData> addChild(Integer id, String parentPath, String name, HierarchyData data);
|
|
/**
|
* 删除节点
|
* @param id 体系ID
|
* @param path 路径
|
*/
|
void deleteNode(Integer id, String path);
|
|
/**
|
* 删除节点
|
* @param id 体系ID
|
* @param paths 路径列表
|
*/
|
void deleteNodes(Integer id, List<String> paths);
|
|
/**
|
* 获取若干层级下所有的节点路径
|
*/
|
List<String> findAllPaths(Integer id, List<String> hierarchyPaths);
|
|
/**
|
* 克隆节点(包括所有子节点和关联的问题)到同一个父节点下
|
* 新节点名称为:原名称(克隆)
|
* @param id 体系ID
|
* @param sourcePath 源节点路径
|
* @return 新节点
|
*/
|
TreeNode<HierarchyData> cloneNode(Integer id, String sourcePath);
|
|
|
|
///// 数据导入时候特殊用到的方法 //////
|
|
// void create(HierarchyType type, TreeNode<HierarchyData> root);
|
|
// void delete(HierarchyType type);
|
|
// TreeNode<HierarchyData> getByNamePath(HierarchyType type, String namePath);
|
}
|