Big code cleaning.

This commit is contained in:
2020-01-18 15:01:55 +01:00
parent 6e7ae115e5
commit 16471e9962
36 changed files with 245 additions and 310 deletions
@@ -37,7 +37,7 @@ public class ImageService {
* @param fileUploadService File upload service.
* @param imageRepository Image repository.
*/
public ImageService(UserService userService,
ImageService(UserService userService,
UserRepository userRepository,
FileUploadService fileUploadService,
ImageRepository imageRepository) {
@@ -86,11 +86,11 @@ public class ImageService {
return fileUploadService.loadAvatar(pAvatarFileName);
}
public Optional<Resource> loadImage(final String pImageLink) {
Optional<Resource> loadImage(final String pImageLink) {
return fileUploadService.loadImage(pImageLink);
}
public List<ImageDTO> getUserImages(final Principal pPrincipal) {
List<ImageDTO> getUserImages(final Principal pPrincipal) {
return imageRepository.getByUserId(userService.getUserByPrincipal(pPrincipal)
.map(User::getId)
.orElseThrow(NoSuchElementException::new))