class UserController {

    @ApiOperation(value = "Update user profile picture")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = HttpStatuses.OK),
            @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER),
            @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST),
            @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN)
    })
    @PatchMapping(path = "/profilePicture",
            consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE})
    public ResponseEntity<HttpStatus> updateUserProfilePicture(@ApiParam(value = "Profile picture")
                                                               @ImageValidation
                                                               @RequestPart(required = false) MultipartFile image,
                                                               @ApiIgnore
                                                               @AuthenticationPrincipal Principal principal) {
        String email = principal.getName();
        userService.updateUserProfilePicture(image, email);
        return ResponseEntity.status(HttpStatus.OK).build();
    }

}