Package com.skyline.base.model

Examples of com.skyline.base.model.Notification


    List<Notification> notifications = jdbcTemplate.query(findNotificationByIdSql, NotificationMapper.getMapper(),
        id);
    if (notifications == null || notifications.size() <= 0) {
      return null;
    } else {
      Notification notification = notifications.get(0);
      //this.deleteNotificationByResource(notification.getOwnerId(),notification.getResourceId(), notification.getType());
      return notification;
    }
  }
View Full Code Here


   *            通知的ID
   * @return ModelAndView
   */
  @RequestMapping(value = "/view/{id}", method = RequestMethod.GET)
  public ModelAndView viewNotifiction(@PathVariable Long id) {
    Notification notification = noticeService.getNotificationById(id);
    String viewName = null;
    if (notification != null) {
      if (notification.getType().equals(NotificationType.ARTICLE_COMMENT)) {
        viewName = "/article/view/" + notification.getResourceId();
      } else if (notification.getType().equals(NotificationType.ALBUM_COMMENT)) {
        // TODO:
      } else if (notification.getType().equals(NotificationType.ATTENTION)) {
        // TODO:
      } else if (notification.getType().equals(NotificationType.MANAGE_NOTIFICATION)) {
        // TODO:
      } else if (notification.getType().equals(NotificationType.PHOTO_COMMENT)) {
        // TODO:
      }
    }
    viewName += URL_SUFFIX;
    ModelAndView mav = new ModelAndView();
View Full Code Here

  @Override
  public List<Notification> getNotificationByOwnerId(Long ownerId) {
    List<Notification> unsortedNotifs = noticeDao.findNotificationByOwnerId(ownerId);
    List<Notification> sortedNotifs = new ArrayList<Notification>();
    for (Notification notif : unsortedNotifs) {
      Notification sameNotif = getSameNotif(notif, sortedNotifs);
      if (sameNotif == null) {
        sortedNotifs.add(notif);
      } else {
        sortedNotifs.remove(sameNotif);
        sameNotif.setSecondNotifierId(notif.getNotifierId());
        sameNotif.setSecondNotifierNickname(notif.getNotifierNickname());
        sortedNotifs.add(sameNotif);
      }
    }
    return sortedNotifs;
  }
View Full Code Here

    return null;
  }

  @Override
  public Notification getNotificationById(Long id) {
    Notification notification= noticeDao.findNotificationById(id);
    if(notification==null){
      return null;
    }
    else{
      noticeDao.deleteNotificationByResource(notification.getId(),notification.getResourceId(), notification.getType());
      return notification;
    }
  }
View Full Code Here

  public static NotificationMapper getMapper() {
    return MAPPER;
  }

  public Notification mapRow(ResultSet rs, int rowNum) throws SQLException {
    Notification notification = new Notification();
    notification.setId(rs.getLong("id"));
    notification.setNotifierId(rs.getLong("notifierId"));
    notification.setNotifierNickname(rs.getString("notifierNickname"));
    notification.setOwnerId(rs.getLong("ownerId"));
    notification.setResourceId(rs.getLong("resourceId"));
    notification.setResourceTitle(rs.getString("resourceTitle"));
    notification.setType(NotificationType.valueOf(rs.getString("type")));
    return notification;
  }
View Full Code Here

TOP

Related Classes of com.skyline.base.model.Notification

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.