示例#1
0
 @RequestMapping(value = "/userpic/upload", method = RequestMethod.POST)
 public String uploadUserPicture(
     @RequestPart("profilePicture") Part userPicrure, Principal principal) throws IOException {
   User user = userService.findUser(principal.getName());
   userService.uploadPicture(userPicrure, user.getId());
   return "redirect:/";
 }
示例#2
0
 @RequestMapping(value = "/userpic/remove", method = RequestMethod.POST)
 public String removeUserPicture(Principal principal) {
   User user = userService.findUser(principal.getName());
   userService.removePicture(user.getId());
   return "redirect:/";
 }