private CmsComment checkById(Integer id, CmsUser checkUser, boolean checked) { CmsComment bean = findById(id); Updater<CmsComment> updater = new Updater<CmsComment>(bean); bean = dao.updateByUpdater(updater); bean.setChecked(checked); return bean; }
public CmsComment comment( Integer score, String text, String ip, Integer contentId, Integer siteId, Integer userId, boolean checked, boolean recommend) { CmsComment comment = new CmsComment(); comment.setContent(contentMng.findById(contentId)); comment.setSite(cmsSiteMng.findById(siteId)); if (userId != null) { comment.setCommentUser(cmsUserMng.findById(userId)); } comment.setChecked(checked); comment.setRecommend(recommend); comment.init(); dao.save(comment); text = cmsSensitivityMng.replaceSensitivity(text); cmsCommentExtMng.save(ip, text, comment); contentCountMng.commentCount(contentId); return comment; }