Пример #1
0
 @RequestMapping("replyList")
 @ResponseBody
 public String replyList(String uid, String params) {
   Result result = null;
   try {
     JSONObject jsonObject = JSON.parseObject(params);
     Integer pageNum = jsonObject.getInteger("pageNum");
     Integer newsId = jsonObject.getInteger("cofId");
     if (newsId != null) {
       List<COFReplyVO> replyList = cofService.getReplyListByNewsId(newsId, pageNum);
       result = Result.getSuccessResult();
       Map<String, Object> map = Maps.newHashMap();
       if (replyList != null) {
         map.put("size", replyList.size());
         map.put("replyList", replyList);
       } else {
         map.put("size", 0);
         map.put("replyList", null);
       }
       result.setRe(map);
     } else {
       result = new Result(EEchoCode.ERROR.getCode(), "读取失败,动态ID不能为空");
     }
   } catch (Exception e) {
     log.error(e.getMessage(), e);
   } finally {
     if (result == null) {
       result = new Result(EEchoCode.ERROR.getCode(), "读取失败,未找到相关的回复");
     }
   }
   return ResultUtil.getJsonString(result);
 }