Package com.skyline.base.exception

Examples of com.skyline.base.exception.NoResourceException


      mav.addObject("page", page);

      mav.addObject("AUTHORITY", authority);
      return mav;
    } else {
      throw new NoResourceException();
      // return null;
    }
  }
View Full Code Here


  public ModelAndView wo(@PathVariable long ownerId) {
    ModelAndView mav = new ModelAndView();
    User user = (User) personalInfoService.getPersonInfoByUserID(ownerId);

    if (user == null) {
      throw new NoResourceException();
    } else {
      mav.setViewName(ViewPaths.WO_WO);
      mav.addObject("woOwner", user);
    }
    return mav;
View Full Code Here

    if (ownerId == 0) {
      ownerId = viewerId;
    }
    // 两者都为0,这种情况不应该存在
    if (ownerId == 0) {
      throw new NoResourceException("Id为0用户相册列表不存在");
    }
    return albumDao.queryAlbumDetailsByUserIdWithPortrait(ownerId, authority, page);
  }
View Full Code Here

    if (ownerId == 0) {
      ownerId = viewerId;
    }
    // 两者都为0,这种情况不应该存在
    if (ownerId == 0) {
      throw new NoResourceException("Id为0用户相册列表不存在");
    }
    return albumDao.queryAlbumsByUserIdWithoutPortrait(ownerId, authority, page);
  }
View Full Code Here

  @Override
  public Album getAlbumById(long albumId) {
    Album album = albumDao.queryAlbumById(albumId);
    if (album == null) {
      throw new NoResourceException("Id为" + albumId + "的相册不存在");
    }
    Activity act = album.getActivity();
    if (act == Activity.DELETED || act == Activity.FREEZED) {
      throw new NoResourceException("Id为" + albumId + "的相册已删除或者已被屏蔽");
    }
    return album;
  }
View Full Code Here

  @Override
  public List<Photo> listPhotosOfAlbum(long albumId, long viewerId, int authority, Page page,
      boolean addVisit) {
    if (albumId == 0) {
      throw new NoResourceException("Id为0的相册不存在");
    }
    List<Photo> photos = photoDao.queryPhotosWithDetailOfAlbum(albumId, authority, page);
    // 非当前用户需要
    if (photos != null && !photos.isEmpty()) {
      long ownerId = photos.get(0).getOwnerId();
View Full Code Here

  @Override
  public Album getAlbumForChange(long albumId, long userId) {
    Album album = albumDao.queryAlbumDetailById(albumId);
    if(album == null) {
      throw new NoResourceException("Id为" + albumId + "的相册不存在!");
    }
    if (album.getOwnerId() != userId) {
      throw new NoOperatePermissionException("ID为" + userId + "的用户无法操作ID为" + albumId + "的相册");
    }
    Activity act = album.getActivity();
View Full Code Here

  }

  @Override
  public Photo getPhotoDetailById(long photoId, long viewerId, boolean addVisit) {
    if (photoId == 0) {
      throw new NoResourceException("Id为0的图片不存在");
    }
    Photo photo = photoDao.queryPhotoDetailById(photoId);
    if (photo == null) {
      throw new NoResourceException("Id为" + photoId + "的图片不存在");
    }
    Activity act = photo.getActivity();
    if (act == Activity.DELETED || act == Activity.FREEZED) {
      throw new NoResourceException("Id为" + photoId + "的照片已删除或者已被屏蔽");
    }
    if (addVisit && photo.getOwnerId() != viewerId) {
      photoDao.updateVisitCount(photo.getAlbumId(), photoId, 1);
    }
    return photo;
View Full Code Here

  @Override
  public Photo getPhotoForChange(long userId, long photoId) {
    Photo photo = photoDao.queryPhotoDetailById(photoId);
    if(photo == null) {
      throw new NoResourceException("Id为" + photoId + "的图片不存在!");
    }
    if (photo.getOwnerId() != userId) {
      throw new NoOperatePermissionException("Id为" + userId + "的用户没有修改Id为" + photoId
          + "图片的权限");
    }
View Full Code Here

  }

  @Override
  public List<Album> listAlbumNamesOfUser(long userId) {
    if (userId == 0) {
      throw new NoResourceException("Id为0用户相册列表不存在");
    }
    return albumDao.queryAlbumNamesOfUser(userId);
  }
View Full Code Here

TOP

Related Classes of com.skyline.base.exception.NoResourceException

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.