Examples of CmsComment


Examples of com.jeecms.cms.entity.assist.CmsComment

      return FrontUtils.showMessage(request, model, "member.memberClose");
    }
    if (user == null) {
      return FrontUtils.showLogin(request, model, site);
    }
    CmsComment comment=commentMng.findById(id);
    if(!comment.getCommentUser().equals(user)){
      WebErrors errors=WebErrors.create(request);
      errors.addErrorCode("error.noPermissionsView");
      return FrontUtils.showError(request, response, model, errors);
    }
    model.addAttribute("comment", comment);
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

    }
    if (user == null) {
      return FrontUtils.showLogin(request, model, site);
    }
    // 删除单条评论
    CmsComment bean;
    if (commentId != null) {
      bean = commentMng.deleteById(commentId);
      log.info("delete CmsComment id={}", bean.getId());
    } else {
      // 依据评论人或者评论ip删除评论
      List<CmsComment> comments = commentMng.getListForDel(site.getId(),
          user.getId(), userId, ip);
      for (int i = 0; i < comments.size(); i++) {
        bean = comments.get(i);
        commentMng.deleteById(comments.get(i).getId());
        log.info("delete CmsComment id={}", bean.getId());
      }
    }
    /*
     * Pagination pagination = commentMng.getPageForMember(site.getId(),
     * null, null, user.getId(), null, null, null, true, cpn(pageNo),
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

        desc, count, true);
  }

  @Transactional(readOnly = true)
  public CmsComment findById(Integer id) {
    CmsComment entity = dao.findById(id);
    return entity;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

    return entity;
  }

  public CmsComment comment(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;
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

    cmsCommentExtMng.deleteByContentId(contentId);
    return dao.deleteByContentId(contentId);
  }

  public CmsComment deleteById(Integer id) {
    CmsComment bean = dao.deleteById(id);
    return bean;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

    }
    return beans;
  }

  public void ups(Integer id) {
    CmsComment comment = findById(id);
    comment.setUps((short) (comment.getUps() + 1));
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

    CmsComment comment = findById(id);
    comment.setUps((short) (comment.getUps() + 1));
  }

  public void downs(Integer id) {
    CmsComment comment = findById(id);
    comment.setDowns((short) (comment.getDowns() + 1));
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

  private boolean vldExist(Integer id, Integer siteId, WebErrors errors) {
    if (errors.ifNull(id, "id")) {
      return true;
    }
    CmsComment entity = manager.findById(id);
    if (errors.ifNotExist(entity, CmsComment.class, id)) {
      return true;
    }
    if (!entity.getSite().getId().equals(siteId)) {
      errors.notInSite(CmsComment.class, id);
      return true;
    }
    return false;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

    f.setCacheable(cacheable);
    return f;
  }

  public CmsComment findById(Integer id) {
    CmsComment entity = get(id);
    return entity;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsComment

    getSession().save(bean);
    return bean;
  }

  public CmsComment deleteById(Integer id) {
    CmsComment entity = super.get(id);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.