Package com.jeecms.cms.entity.main

Examples of com.jeecms.cms.entity.main.ContentCount


        + ",a.upsDay=(select b.upsDay from ContentCount b where a.id=b.id)";
    return getSession().createQuery(hql).executeUpdate();
  }

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


  /**
   * @see ContentCountCache#viewAndGet(Integer)
   */
  public int[] viewAndGet(Integer id) {
    ContentCount count = contentCountMng.findById(id);
    if (count == null) {
      return null;
    }
    Element e = cache.get(id);
    Integer views;
    if (e != null) {
      views = (Integer) e.getValue() + 1;
    } else {
      views = 1;
    }
    cache.put(new Element(id, views));
    refreshToDB();
    return new int[] { views + count.getViews(), count.getComments(),
        count.getDownloads(), count.getUps(), count.getDowns() };
  }
View Full Code Here

@Service
@Transactional
public class ContentCountMngImpl implements ContentCountMng {
  public int contentUp(Integer id) {
    ContentCount c = dao.findById(id);
    if (c == null) {
      return 0;
    }
    int count = c.getUps() + 1;
    c.setUps(count);
    c.setUpsMonth(c.getUpsMonth() + 1);
    c.setUpsWeek((short) (c.getUpsWeek() + 1));
    c.setUpsDay((short) (c.getUpsDay() + 1));
    return count;
  }
View Full Code Here

    c.setUpsDay((short) (c.getUpsDay() + 1));
    return count;
  }

  public int contentDown(Integer id) {
    ContentCount c = dao.findById(id);
    if (c == null) {
      return 0;
    }
    int count = c.getDowns() + 1;
    c.setDowns(count);
    return count;
  }
View Full Code Here

    c.setDowns(count);
    return count;
  }

  public void downloadCount(Integer contentId) {
    ContentCount c = findById(contentId);
    c.setDownloads(c.getDownloads() + 1);
    c.setDownloadsMonth(c.getDownloadsMonth() + 1);
    c.setDownloadsWeek((short) (c.getCommentsWeek() + 1));
    c.setDownloadsDay((short) (c.getDownloadsDay() + 1));
  }
View Full Code Here

    c.setDownloadsWeek((short) (c.getCommentsWeek() + 1));
    c.setDownloadsDay((short) (c.getDownloadsDay() + 1));
  }

  public void commentCount(Integer contentId) {
    ContentCount c = findById(contentId);
    c.setComments(c.getComments() + 1);
    c.setCommentsMonth(c.getCommentsMonth() + 1);
    c.setCommentsWeek((short) (c.getCommentsWeek() + 1));
    c.setCommentsDay((short) (c.getCommentsDay() + 1));
  }
View Full Code Here

    }
  }

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

    return count;
  }

  public ContentCount update(ContentCount bean) {
    Updater<ContentCount> updater = new Updater<ContentCount>(bean);
    ContentCount entity = dao.updateByUpdater(updater);
    return entity;
  }
View Full Code Here

    contentExtMng.save(ext, bean);
    contentTxtMng.save(txt, bean);
    ContentCheck check = new ContentCheck();
    check.setCheckStep(userStep);
    contentCheckMng.save(check, bean);
    contentCountMng.save(new ContentCount(), bean);
    // 保存副栏目
    if (channelIds != null && channelIds.length > 0) {
      for (Integer cid : channelIds) {
        bean.addToChannels(channelMng.findById(cid));
      }
View Full Code Here

TOP

Related Classes of com.jeecms.cms.entity.main.ContentCount

Copyright © 2018 www.massapicom. 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.