albumId, albumName, authority, activity, fileKeys, middleFileKeys, smallFileKeys,
fileExts, fileSizes);
albumDao.updatePhotoCount(userId, albumId, ids.size());
List<Photo> photos = new ArrayList<Photo>(size);
for (int i = 0; i < size; i++) {
ImageResizeResult result = filesInfo.get(i);
String[] keys = result.getFileKeys();
if(ids.get(i) == null) {//返回为空,表示插入失败
continue;
}
Photo photo = new Photo();
photo.setId(ids.get(i));
photo.setOwnerId(userId);
photo.setOwnerNickname(userNickname);
photo.setOwnerPortrait(userPortrait);
photo.setAlbumId(albumId);
photo.setAlbumName(albumName);
photo.setAuthority(authority);
photo.setActivity(activity);
photo.setFile(keys[0]);
photo.setMiddleFile(keys[1]);
photo.setSmallFile(keys[2]);
photo.setExt(result.getExt());
photo.setSize(result.getFileSize());
photos.add(photo);
}
return photos;
}