* */
@SuppressWarnings("unchecked")
@RequestMapping(value = "/upload/{albumId}", method = RequestMethod.POST)
public ModelAndView normalUpload(@PathVariable("albumId") Long albumId, String submitToken,
MultipartHttpServletRequest request) {
User user = (User) WebHelper.getSessionAttribute(request, Constant.SESSION_USER);
if (user == null) {
throw new NotLoginException("上传照片必须登录");
}
String errMsg = validateForm("normalUploadForm", submitToken);
if (errMsg != null) {
ModelAndView returnMav = toUpload(albumId);
return processValidationErrors("errMsg", errMsg, returnMav);
}
long userId = user.getId();
Album album = albumService.getAlbumForChange(albumId, userId);
List<MultipartFile> files = request.getFiles("file");
StringBuilder message = new StringBuilder();
List<SkylineImageResizeTask> tasks = prepareResizeTask(files, userId, albumId, message);
if (CollectionUtils.isEmpty(tasks)) {