public void save() { boolean flag = false; BBSMessage bbsMessage = getBBSMessage(); try { bbsMessage.setScannum(Long.parseLong("0")); bbsMessage.setIsessence(0); bbsMessageService.saveEntity(bbsMessage); flag = true; super.reponseWriter(JSON.toJSONString(flag)); } catch (NumberFormatException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }
public String addMsg() { boolean flag = false; BBSMessage bbsMessage = getBBSMessage(); try { bbsMessage.setScannum(Long.parseLong("0")); bbsMessage.setIsessence(0); bbsMessageService.saveEntity(bbsMessage); flag = true; } catch (NumberFormatException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } if (flag) { return "bbs_index"; } else { errmsg = "发帖失败"; return "bbs_sent"; } }
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"; }