Package com.skyline.wo.model

Examples of com.skyline.wo.model.Album


      return;
    }

    try {
      long userId = user.getId();
      Album album = albumService.getUserPortraitAlbum(userId);
      long albumId = album.getId();

      MultipartFile file = ((MultipartHttpServletRequest) request).getFile("file");
      if (file == null) {
        jsonMap = resultToJsonMap(ResultState.NO_FILE_EXIST, null);
        OutputStream out = response.getOutputStream();
View Full Code Here


      outputJsonResult(out, jsonMap);
      return;
    }

    try {
      Album album =albumService.getAlbumById(albumId);
      Spot spot=spotService.getSpot(spotId);
      MultipartFile file = ((MultipartHttpServletRequest) request).getFile("file");
      if (file == null) {
        jsonMap = resultToJsonMap(ResultState.NO_FILE_EXIST, null);
        OutputStream out = response.getOutputStream();
View Full Code Here

    Spot spot = spotService.getSpot(spotId);
    if (spot == null) {
      mav.setViewName(ViewPaths.SPOT_NOTFOUND);
      return mav;
    }
    Album album = new Album();
    album.setAlbumName(spot.getName());
    album.setPlace(spot.getCity());
    album.setDescription(spot.getName());
    album.setAuthority(Authority.PUBLIC);
    album = albumService.createAlbum(user, album);
    mav.addObject("album", album);
    mav.addObject("spotId", spot.getId());
    mav.setViewName(ViewPaths.SOPTREF_NEWALBUMREF);
    return mav;
View Full Code Here

    List<ImageResizeResult> results = imagine.processImage(localStorePath,
        tasks);
    List<ImageResizeResult> filesInfo = processResizeResult(results,
        message);

    Album album = null;
    try {
      album = albumService.getAlbumForChange(albumId, user.getId());
    } catch (Exception e) {
      LOGGER.warn("获取相册失败", e);
      result.put("success", Boolean.FALSE);
      result.put("errmsg", "没有找到对应相册,压缩图片失败!");
      return result;

    }
    List<Photo> photos = null;

    if (!filesInfo.isEmpty()) {
      photos = albumService.createPhotos(user, album, filesInfo);
    }
    albumService.changeAlbumCover(user.getId(), album.getId(), photos
        .get(0).getSmallFile(), photos.get(0).getExt());

    Map<Long, List<Photo>> filesMap = (Map<Long, List<Photo>>) WebHelper
        .getSessionAttribute(null, Constant.SESSION_UPLOAD_OK_FILES);
    if (filesMap == null) {
      filesMap = new HashMap<Long, List<Photo>>();
    }
    filesMap.put(album.getId(), photos);
    WebHelper.setSessionAttribute(null, Constant.SESSION_UPLOAD_OK_FILES,
        filesMap);

    if (StringUtils.hasLength(message)) {// 存在错误
      result.put("success", Boolean.FALSE);
View Full Code Here

    if (spot == null) {
      mav.setViewName(ViewPaths.SPOT_NOTFOUND);
      return mav;
    }
    Album album = albumService.getAlbumById(albumId);
    if (album == null) {
      mav.setViewName(ViewPaths.SPOT_NOTFOUND);
      return mav;
    }
    Long returnRefId = spotRefrenceService.postToSpot(album.getId(),
        album.getCover() + "." + album.getCoverExt(), refTitle,
        refrenceDigest, SpotRefrenceType.ALBUM, spotId, spot.getName(),
        spot.getPortrait(), user.getId(), user.getNickname(),
        user.getPortrait(), user.getEmail());
    if (returnRefId == 0 || returnRefId == null) {
      mav.setViewName(ViewPaths.SPOT_NOTFOUND);
View Full Code Here

      Page page = new Page();
      page.setSize(1);
      SpotRefrence spotRef = spotRefrenceService
          .getRefrencesBySpotIdAndType(spotId,
              SpotRefrenceType.ALBUM, page).get(0);
      Album album = albumService.getAlbumById(spotRef.getRefrenceId());
      List<Photo> photosList = albumService.listPhotosOfAlbum(
          album.getId(), 0, Authority.PUBLIC, page, true);
      mav.addObject("photoList", photosList);
      mav.addObject("albumInfo", album);
      mav.addObject("refInfo", spotRef);
      return mav;
View Full Code Here

  @Cache(keyPattern = "album-l-names-u:uid", type = CacheCategoryType.ALBUM)
  public List<Album> queryAlbumNamesOfUser(@Param("uid") @Fk long userId) {
    return jdbcTemplate.query(queryAlbumNamesOfUserSql, new RowMapper<Album>() {
      public Album mapRow(ResultSet rs, int rowNum) throws SQLException {
        Album album = new Album();
        album.setId(rs.getLong(AlbumMapper.COLUMN_ID));
        album.setAlbumName(rs.getString(AlbumMapper.COLUMN_ALBUM_NAME));
        album.setPhotoNum(rs.getInt(AlbumMapper.COLUMN_PHOTO_NUM));
        album.setCover(rs.getString(AlbumMapper.COLUMN_COVER));
        album.setCoverExt(rs.getString(AlbumMapper.COLUMN_COVER_EXT));
        return album;
      }
    }, userId, Activity.NORMAL.toString());
  }
View Full Code Here

      @PathVariable("spotcharaId") Long spotcharaId, @PathVariable("albumId") Long albumId) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null) {
      throw new NotLoginException("上传照片必须登录");
    }
    Album album = albumService.getAlbumForChange(albumId, spotId);
    ModelAndView mav = new ModelAndView(ViewPaths.SPOTCHARA_UPLOADPHOTO);
    mav.addObject("charaId", spotcharaId);
    mav.addObject("spotId", spotId);
    mav.addObject("album", album);
    // WebHelper.saveToken(request);
View Full Code Here

    }

    List<ImageResizeResult> results = imagine.processImage(localStorePath, tasks);
    List<ImageResizeResult> filesInfo = processResizeResult(results, message);

    Album album = null;
    try {
      album = albumService.getAlbumForChange(albumId, ownerId);
    } catch (Exception e) {
      LOGGER.warn("获取相册失败", e);
      result.put("success", Boolean.FALSE);
      result.put("errmsg", "没有找到对应相册,压缩图片失败!");
      return result;

    }
    List<Photo> photos = null;

    if (!filesInfo.isEmpty()) {
      /**
       * 构造一个spot User
       */
      User tempUser = new User();
      tempUser.setId(ownerId);
      tempUser.setNickname(spot.getName());
      tempUser.setPortrait(spot.getPortrait());
      photos = albumService.createPhotos(tempUser, album, filesInfo);
    }

    Map<Long, List<Photo>> filesMap = (Map<Long, List<Photo>>) WebHelper.getSessionAttribute(
        null, Constant.SESSION_UPLOAD_OK_FILES);
    if (filesMap == null) {
      filesMap = new HashMap<Long, List<Photo>>();
    }
    filesMap.put(album.getId(), photos);
    WebHelper.setSessionAttribute(null, Constant.SESSION_UPLOAD_OK_FILES, filesMap);

    if (StringUtils.hasLength(message)) {// 存在错误
      result.put("success", Boolean.FALSE);
      result.put("errmsg", message);
View Full Code Here

    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null) {
      throw new NotLoginException("上传照片必须登录");
    }
//    long userId = user.getId();
    Album album = albumService.getAlbumForChange(albumId, ownerId);
    ModelAndView mav = new ModelAndView(ViewPaths.SPOTCHARA_UPLOADOK);
    mav.addObject("album", album);
    mav.addObject("spotId", ownerId);
    mav.addObject("charaId", charaId);
    // WebHelper.saveToken(request);
View Full Code Here

TOP

Related Classes of com.skyline.wo.model.Album

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.