-
guqing created a review on pull request #29 in halo-sigs/plugin-moments
-
guqing starred dwarvesf/hidden
-
guqing created a review on pull request #8 in halo-sigs/plugin-photos
-
guqing commented on issue #23 in halo-sigs/plugin-oauth2
-
guqing pushed to refs/heads/feature/32 in halo-sigs/plugin-oauth2
-
guqing commented on issue #4173 in halo-dev/halo
你可以先参考下面的实现方式来修改代码:
CategoryTreeVo createVirtualRoot(List<CategoryTreeVo> categoryTrees) { return CategoryTreeVo.builder() .spec(new Category.CategorySpec()) .status(new Category.CategoryStatus()) .metadata(new Metadata()) .children(categoryTrees) .build(); } public boolean findNodePath(CategoryTreeVo root, String nodeToFind, List<String> result) { if (root == null) { return false; } if (StringUtils.equals(root.getMetadata().getName(), nodeToFind)) { result.add(root.getMetadata().getName()); return true; } for (CategoryTreeVo child : root.getChildren()) { if (findNodePath(child, nodeToFind, result)) { result.add(root.getMetadata().getName()); return true; } } return false; }
使用示例
// 将 listToTree 的返回结果作为参数传入 CategoryTreeVo virtualRoot = createVirtualRoot(treeVos); List<String> result = new ArrayList<>(); findNodePath(virtualRoot, "ed064d5e-2b6f-4123-8114-78d0c6f2c4e2", result);
在写的时候可能需要注意以下几点:
- 不要在方法体中使用 block 有关的几个操作符,它是阻塞的不能在非阻塞的线程中调用
- 不要将 Mono 或者 Flux 作为方法的参数
-
guqing pushed to refs/heads/feature/32 in halo-sigs/plugin-oauth2
-
guqing commented on issue #33 in halo-sigs/plugin-oauth2
-
guqing commented on issue #50 in campcc/blog
本文首发于我的 博客,才疏学浅,难免有错误,文章有误之处还望不吝指正
这确定不是抄袭的 为什么你不应该在 React 中直接使用 useEffect 从 API 获取数据 这篇文章?
-
guqing pushed to refs/heads/feature/6 in halo-sigs/plugin-highlightjs