/** * 查询文档前n条评论和评论总数 * * @param sortKey 排序关键字 * @param desc 排序方式 * @param docId 文档ID * @param HttpServletRequest request * @return String * @throws Exception Exception */ public @ResponseBody(datatype = "jsonp") NComentList getDocumentCommentNList(int docId, int n) { try { NComentList docCommentList = docCommentManager.getCommnetList(docId, n); return docCommentList; } catch (Exception e) { return null; } }
/** * 展示所有该文档的评论 * * @param sortKey * @param desc * @param offset * @param pagesize * @param docId * @param request * @param response * @return * @throws Exception */ public String showAllCommentList( @PagerParam(name = PagerParam.SORT, defaultvalue = "title") String sortKey, @PagerParam(name = PagerParam.DESC, defaultvalue = "false") boolean desc, @PagerParam(name = PagerParam.OFFSET) long offset, @PagerParam(name = PagerParam.PAGE_SIZE, defaultvalue = "50") int pagesize, int docId, HttpServletRequest request, HttpServletResponse response) throws Exception { ListInfo docCommentList = docCommentManager.getCommnetList(docId, (int) offset, pagesize); request.setAttribute("docCommentList", docCommentList); request.setAttribute("docId", docId); return "path:showAllCommentList"; }