Package ru.org.linux.site

Examples of ru.org.linux.site.DeleteInfo


  private ApiDeleteInfo loadDeleteInfo(Comment comment) throws UserNotFoundException {
    ApiDeleteInfo deleteInfo = null;

    if (comment.isDeleted()) {
      DeleteInfo info = deleteInfoDao.getDeleteInfo(comment.getId());

      if (info!=null) {
        deleteInfo = new ApiDeleteInfo(
                userDao.getUserCached(info.getUserid()).getNick(),
                info.getReason()
        );
      }
    }

    return deleteInfo;
View Full Code Here


    return jdbcTemplate.update("UPDATE topics SET deleted='t',sticky='f' WHERE id=? AND NOT deleted", msgid)>0;
  }

  @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
  public void undelete(Topic message) {
    DeleteInfo deleteInfo = deleteInfoDao.getDeleteInfo(message.getId(), true);

    if (deleteInfo!=null && deleteInfo.getBonus()!=0) {
      userDao.changeScore(message.getUid(), -deleteInfo.getBonus());
    }

    jdbcTemplate.update(updateUndeleteMessage, message.getId());
    jdbcTemplate.update(updateUneleteInfo, message.getId());
  }
View Full Code Here

      User commentAuthor;
      int bonus = 0;

      if (event.isComment()) {
        if("DEL".equals(event.getType().getType())) {
          DeleteInfo deleteInfo = deleteInfoDao.getDeleteInfo(event.getCid());
          if(deleteInfo != null) {
            bonus = deleteInfo.getBonus();
          }
        }

        commentAuthor = userDao.getUserCached(event.getCommentAuthor());
      } else {
        commentAuthor = null;
        if("DEL".equals(event.getType().getType())) {

          DeleteInfo deleteInfo = deleteInfoDao.getDeleteInfo(event.getMsgid());
          if(deleteInfo != null) {
            bonus = deleteInfo.getBonus();
          }
        }
      }

      Group group = groupDao.getGroup(event.getGroupId());
View Full Code Here

    try {
      Group group = groupDao.getGroup(message.getGroupId());
      User author = userDao.getUserCached(message.getUid());
      Section section = sectionService.getSection(message.getSectionId());

      DeleteInfo deleteInfo;
      User deleteUser;
      if (message.isDeleted()) {
        deleteInfo = deleteInfoDao.getDeleteInfo(message.getId());

        if (deleteInfo!=null) {
          deleteUser = userDao.getUserCached(deleteInfo.getUserid());
        } else {
          deleteUser = null;
        }
      } else {
        deleteInfo = null;
View Full Code Here

        Integer bonus = resultSet.getInt("bonus");
        if (resultSet.wasNull()) {
          bonus = null;
        }

        return new DeleteInfo(
                resultSet.getInt("userid"),
                resultSet.getString("reason"),
                resultSet.getTimestamp("deldate"),
                bonus
        );
View Full Code Here

TOP

Related Classes of ru.org.linux.site.DeleteInfo

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.