From 74114fee6067b12b00c905632d117f16c88c83e4 Mon Sep 17 00:00:00 2001 From: kdomo Date: Tue, 16 Jan 2024 21:31:03 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20imageFileExtension=20nullable=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/request/MemberProfileImageUploadCompleteRequest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java b/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java index 9e8d4ac83..2207acba2 100644 --- a/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java +++ b/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java @@ -2,10 +2,8 @@ import com.depromeet.domain.image.domain.ImageFileExtension; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; public record MemberProfileImageUploadCompleteRequest( - @NotNull(message = "이미지 파일의 확장자는 비워둘 수 없습니다.") - @Schema(description = "이미지 파일의 확장자", defaultValue = "JPEG") + @Schema(description = "이미지 파일의 확장자", defaultValue = "JPEG") ImageFileExtension imageFileExtension, @Schema(description = "닉네임", defaultValue = "당근조이") String nickname) {} From 63e67e057c9d400a25fc9837924d16f00724ed26 Mon Sep 17 00:00:00 2001 From: kdomo Date: Tue, 16 Jan 2024 21:31:36 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=EB=8B=89=EB=84=A4=EC=9E=84=20Notnul?= =?UTF-8?q?l=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/request/MemberProfileImageUploadCompleteRequest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java b/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java index 2207acba2..868e5e38a 100644 --- a/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java +++ b/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java @@ -2,8 +2,10 @@ import com.depromeet.domain.image.domain.ImageFileExtension; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; public record MemberProfileImageUploadCompleteRequest( @Schema(description = "이미지 파일의 확장자", defaultValue = "JPEG") ImageFileExtension imageFileExtension, + @NotNull(message = "닉네임은 비워둘 수 없습니다.") @Schema(description = "닉네임", defaultValue = "당근조이") String nickname) {} From 4beb272de5ef67a98a0aa5b23e3028c5139ccaa9 Mon Sep 17 00:00:00 2001 From: kdomo Date: Tue, 16 Jan 2024 21:31:53 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20null?= =?UTF-8?q?=EB=A1=9C=20=EB=84=98=EC=96=B4=EC=99=94=EC=9D=84=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20=EB=8B=89=EB=84=A4=EC=9E=84=EB=A7=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/image/application/ImageService.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/depromeet/domain/image/application/ImageService.java b/src/main/java/com/depromeet/domain/image/application/ImageService.java index 71825692a..122d8019c 100644 --- a/src/main/java/com/depromeet/domain/image/application/ImageService.java +++ b/src/main/java/com/depromeet/domain/image/application/ImageService.java @@ -102,12 +102,14 @@ public PresignedUrlResponse createMemberProfilePresignedUrl( public void uploadCompleteMemberProfile(MemberProfileImageUploadCompleteRequest request) { final Member currentMember = memberUtil.getCurrentMember(); - - String imageUrl = - createImageUrl( - ImageType.MEMBER_PROFILE, - currentMember.getId(), - request.imageFileExtension()); + String imageUrl = null; + if (request.imageFileExtension() != null) { + imageUrl = + createImageUrl( + ImageType.MEMBER_PROFILE, + currentMember.getId(), + request.imageFileExtension()); + } currentMember.updateProfile(Profile.createProfile(request.nickname(), imageUrl)); } From 88ded12cf24f6a8267b9e5ab724082e53d3aa723 Mon Sep 17 00:00:00 2001 From: kdomo Date: Tue, 16 Jan 2024 21:32:05 +0900 Subject: [PATCH 4/4] style: spotless --- .../dto/request/MemberProfileImageUploadCompleteRequest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java b/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java index 868e5e38a..571649213 100644 --- a/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java +++ b/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java @@ -7,5 +7,5 @@ public record MemberProfileImageUploadCompleteRequest( @Schema(description = "이미지 파일의 확장자", defaultValue = "JPEG") ImageFileExtension imageFileExtension, - @NotNull(message = "닉네임은 비워둘 수 없습니다.") - @Schema(description = "닉네임", defaultValue = "당근조이") String nickname) {} + @NotNull(message = "닉네임은 비워둘 수 없습니다.") @Schema(description = "닉네임", defaultValue = "당근조이") + String nickname) {}