diff --git a/src/main/java/com/moabam/api/domain/image/ImageName.java b/src/main/java/com/moabam/api/domain/image/ImageName.java index 64082d54..6f2a34db 100644 --- a/src/main/java/com/moabam/api/domain/image/ImageName.java +++ b/src/main/java/com/moabam/api/domain/image/ImageName.java @@ -17,15 +17,19 @@ public class ImageName { private static final String CERTIFICATION_PATH = "certifications" + DELIMITER + LocalDate.now() + DELIMITER; private static final String PROFILE_IMAGE = "members/profile" + DELIMITER; + private static final String BIRD_SKIN = "moabam/skins" + DELIMITER; private static final String DEFAULT = "moabam/default" + DELIMITER; private final String fileName; public static ImageName of(MultipartFile file, ImageType imageType) { return switch (imageType) { - case CERTIFICATION -> new ImageName(CERTIFICATION_PATH + file.getName() + "_" + UUID.randomUUID()); - case PROFILE_IMAGE -> new ImageName(PROFILE_IMAGE + file.getName() + "_" + UUID.randomUUID()); - case DEFAULT -> new ImageName(DEFAULT + file.getName()); + case CERTIFICATION -> + new ImageName(CERTIFICATION_PATH + file.getName() + "_" + UUID.randomUUID() + IMAGE_EXTENSION); + case PROFILE_IMAGE -> + new ImageName(PROFILE_IMAGE + file.getName() + "_" + UUID.randomUUID() + IMAGE_EXTENSION); + case BIRD_SKIN -> new ImageName(BIRD_SKIN + file.getName() + IMAGE_EXTENSION); + case DEFAULT -> new ImageName(DEFAULT + file.getName() + IMAGE_EXTENSION); }; } } diff --git a/src/main/java/com/moabam/api/domain/image/ImageResizer.java b/src/main/java/com/moabam/api/domain/image/ImageResizer.java index 79e44a9e..5a7d65ba 100644 --- a/src/main/java/com/moabam/api/domain/image/ImageResizer.java +++ b/src/main/java/com/moabam/api/domain/image/ImageResizer.java @@ -61,6 +61,7 @@ public void resizeImageToFixedSize(ImageType imageType) { ImageSize imageSize = switch (imageType) { case PROFILE_IMAGE -> ImageSize.PROFILE_IMAGE; case CERTIFICATION -> ImageSize.CERTIFICATION_IMAGE; + case BIRD_SKIN -> ImageSize.BIRD_SKIN; case DEFAULT -> ImageSize.CAGE; }; diff --git a/src/main/java/com/moabam/api/domain/image/ImageType.java b/src/main/java/com/moabam/api/domain/image/ImageType.java index 80cbeba3..dc4dc358 100644 --- a/src/main/java/com/moabam/api/domain/image/ImageType.java +++ b/src/main/java/com/moabam/api/domain/image/ImageType.java @@ -4,5 +4,6 @@ public enum ImageType { PROFILE_IMAGE, CERTIFICATION, + BIRD_SKIN, DEFAULT } diff --git a/src/main/java/com/moabam/global/common/util/GlobalConstant.java b/src/main/java/com/moabam/global/common/util/GlobalConstant.java index ec45d2ec..a9f79ff3 100644 --- a/src/main/java/com/moabam/global/common/util/GlobalConstant.java +++ b/src/main/java/com/moabam/global/common/util/GlobalConstant.java @@ -19,4 +19,5 @@ public class GlobalConstant { public static final int ROOM_FIXED_SEARCH_SIZE = 10; public static final int LEVEL_DIVISOR = 10; public static final int DEFAULT_SKIN_SIZE = 2; + public static final String IMAGE_EXTENSION = ".png"; }