Created
August 29, 2020 14:39
-
-
Save itsgokhanyilmaz/a00ba16b9cb0cb1b5fe0d29bd0b9b0bf to your computer and use it in GitHub Desktop.
UserServiceImpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@RequiredArgsConstructor | |
public class UserServiceImpl implements UserService { | |
private final UserRepository userRepository; | |
private final BlobStorageService blobStorageService; | |
@NotNull | |
final MongoTemplate mongoTemplate; | |
@Override | |
public UserResponse uploadProfilePicture(MultipartFile multipartFile, String userId) throws IOException { | |
String uri = blobStorageService.uploadPicture(multipartFile).toURL().toString(); | |
userRepository.uploadProfilePicture(uri, new ObjectId(userId)); | |
return getUser(userId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment