示例#1
0
  public String save() {
    boolean flag = false;
    MessageComment messageComment = getMessageComment();

    try {
      messageCommentService.saveEntity(messageComment);
      bbsMessageQuery = bbsMessageService.findBBSMessageQuery(messageComment.getMessageid());
      commentslist = bbsMessageService.queryCommentsByMsgId(messageComment.getMessageid());
      flag = true;
      super.reponseWriter(JSON.toJSONString(flag));
    } catch (NumberFormatException e) {
      e.printStackTrace();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return "bbs_detail";
  }
示例#2
0
  public String queryBBSMessageDetail() {
    super.commonQuery();
    String id = request.getParameter("id");
    try {
      bbsMessageQuery = bbsMessageService.findBBSMessageQuery(Long.parseLong(id));
      BBSMessage bbs = new BBSMessage();
      bbs.setId(bbsMessageQuery.getId());
      bbs.setContent(bbsMessageQuery.getContent());
      bbs.setCreateTime(bbsMessageQuery.getCreateTime());
      bbs.setScannum(bbsMessageQuery.getScannum() + 1);
      bbs.setTitle(bbsMessageQuery.getTitle());
      bbs.setUserid(bbsMessageQuery.getUserid());

      bbsMessageService.saveEntity(bbs);
      commentslist = bbsMessageService.queryCommentsByMsgId(Long.parseLong(id));
    } catch (NumberFormatException e) {
      e.printStackTrace();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return "bbs_detail";
  }