识别代码 @RequestMapping(value = "/common/tree", method = RequestMethod.GET) public ResponseInfo getCommentTree(Integer siteId, @RequestParam Short operator, HttpServletRequest request) throws GlobalException { if (siteId == null) { siteId = SystemContextUtils.getSiteId(request); } final Integer sid = siteId; List<Channel> channels = SystemContextUtils.getUser(request).getChannelsByOperator(siteId, operator); if (channels.size() > 0) { channels = channels.stream() .filter(channel -> !channel.getRecycle() && !channel.getHasDeleted() && channel.getSiteId().equals(sid)) .sorted(Comparator.comparing(Channel::getSortNum) .thenComparing( Comparator.comparing(Channel::getCreateTime))) .collect(Collectors.toList()); } return new ResponseInfo(super.getChildTree(channels, false, "name", "id", "editAble", "createChildAble", "deleteAble", "mergeAble", "staticAble", "permAssignAble", "viewAble")); }
时间: 2023-03-25 11:01:33 浏览: 374
这是一个 Java Spring 框架中的控制器方法,用于获取评论树形结构。其中 @RequestMapping 注解指定了请求的 URL 和请求方法,@RequestParam 注解指定了请求参数。代码中还包含了一些业务逻辑,如获取站点 ID、获取用户权限等。
阅读全文