Skip to content

Instantly share code, notes, and snippets.

@itsgokhanyilmaz
Created August 29, 2020 14:38
Show Gist options
  • Save itsgokhanyilmaz/a30c2363efb68b3acab62a4df154fbf8 to your computer and use it in GitHub Desktop.
Save itsgokhanyilmaz/a30c2363efb68b3acab62a4df154fbf8 to your computer and use it in GitHub Desktop.
UserController
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {
private final UserService userService;
@PostMapping("upload-profile-picture")
public ResponseEntity<MainResponse<UserResponse>> writeBlobFile(@RequestParam(value = "image", required = false) MultipartFile file, HttpServletRequest httpServletRequest) throws IOException {
String userId = JwtUtil.getObjectIdFromRequest(httpServletRequest);
return ResponseUtil.data(userService.uploadProfilePicture(file, userId));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment