Last active
June 29, 2017 17:03
-
-
Save codingtim/90ba3c4e7d429717f704 to your computer and use it in GitHub Desktop.
third
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
public class EntityServiceImpl implements EntityService { | |
private EntityRepository repository; | |
private ImageService imageService; | |
private EntityObservers entityObservers; | |
@Override | |
public void update(String id, UpdateData updateData) { | |
Entity entity = repository.find(id); | |
UpdateData updateDataWithImage = updateData.addImage(imageService.getImage(updateData.getImageUrl())); | |
Entity updatedEntity = entity.update(updateDataWithImage); | |
repository.save(updatedEntity); | |
entityObservers.notifyUpdated(entity, updatedEntity); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment