Skip to content

Instantly share code, notes, and snippets.

@itsgokhanyilmaz
Created August 29, 2020 14:39
Show Gist options
  • Save itsgokhanyilmaz/a00ba16b9cb0cb1b5fe0d29bd0b9b0bf to your computer and use it in GitHub Desktop.
Save itsgokhanyilmaz/a00ba16b9cb0cb1b5fe0d29bd0b9b0bf to your computer and use it in GitHub Desktop.
UserServiceImpl
@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