| | |
| | | /** |
| | | * 获取树图数据结构 |
| | | */ |
| | | @Cacheable(cacheNames="tagTree",key="#id") |
| | | public ArrayList<Map> getTree(String id){ |
| | | @Cacheable(cacheNames = "tagTree", key = "#id") |
| | | public ArrayList<Map> getTree(String id) { |
| | | ArrayList<Map> result = new ArrayList<>(); |
| | | Tag tag = tagService.selectById(id); |
| | | // 主节点 |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", tag.getName()); |
| | | map.put("id", tag.getId()); |
| | | map.put("spread", true); |
| | | map.put("spread", false); |
| | | List<Map> childrens = new ArrayList<>(); |
| | | map.put("children", childrens); |
| | | dealTag(tag, childrens); |
| | |
| | | /** |
| | | * 获取树图数据结构 |
| | | */ |
| | | @Cacheable(cacheNames="nodeTree",key="#id") |
| | | public ArrayList<Map> getNodeTree(String id, Long hostId){ |
| | | @Cacheable(cacheNames = "nodeTree", key = "#id") |
| | | public ArrayList<Map> getNodeTree(String id, Long hostId) { |
| | | ArrayList<Map> result = new ArrayList<>(); |
| | | Node node = nodeService.selectById(id); |
| | | // 主节点 |