From 78c2432eece002a25db5bacb00dcd409de4fecb3 Mon Sep 17 00:00:00 2001 From: woo-chang Date: Sun, 13 Aug 2023 00:06:00 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20(#346)=20=EB=B9=88=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=B2=98=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/post/dto/response/PostOptionResponse.java | 2 +- .../votogether/domain/post/dto/response/PostResponse.java | 2 +- .../domain/post/dto/response/detail/PostDetailResponse.java | 6 +----- .../post/dto/response/detail/PostOptionDetailResponse.java | 6 +----- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/backend/src/main/java/com/votogether/domain/post/dto/response/PostOptionResponse.java b/backend/src/main/java/com/votogether/domain/post/dto/response/PostOptionResponse.java index c78818946..56668ff41 100644 --- a/backend/src/main/java/com/votogether/domain/post/dto/response/PostOptionResponse.java +++ b/backend/src/main/java/com/votogether/domain/post/dto/response/PostOptionResponse.java @@ -24,7 +24,7 @@ public static PostOptionResponse of(final Post post, final PostOption postOption } private static String convertImageUrl(final String imageUrl) { - return imageUrl == null || imageUrl.contains("없는사진") ? "" : imageUrl; + return imageUrl == null ? "" : imageUrl; } public static PostOptionResponse of( diff --git a/backend/src/main/java/com/votogether/domain/post/dto/response/PostResponse.java b/backend/src/main/java/com/votogether/domain/post/dto/response/PostResponse.java index 45368b1c5..8899318e2 100644 --- a/backend/src/main/java/com/votogether/domain/post/dto/response/PostResponse.java +++ b/backend/src/main/java/com/votogether/domain/post/dto/response/PostResponse.java @@ -57,7 +57,7 @@ public static PostResponse of(final Post post, final Member loginMember) { } private static String convertImageUrl(final String imageUrl) { - return imageUrl == null || imageUrl.contains("없는사진") ? "" : imageUrl; + return imageUrl == null ? "" : imageUrl; } private static List getCategories(final Post post) { diff --git a/backend/src/main/java/com/votogether/domain/post/dto/response/detail/PostDetailResponse.java b/backend/src/main/java/com/votogether/domain/post/dto/response/detail/PostDetailResponse.java index 11d1c9e80..1134e2890 100644 --- a/backend/src/main/java/com/votogether/domain/post/dto/response/detail/PostDetailResponse.java +++ b/backend/src/main/java/com/votogether/domain/post/dto/response/detail/PostDetailResponse.java @@ -42,7 +42,7 @@ public static PostDetailResponse of(final Post post, final Member loginMember) { WriterResponse.of(writer.getId(), writer.getNickname()), postBody.getTitle(), postBody.getContent(), - convertImageUrl(contentImageUrl.toString()), + contentImageUrl.toString(), getCategories(postCategories.getPostCategories()), post.getCreatedAt(), post.getDeadline(), @@ -54,10 +54,6 @@ public static PostDetailResponse of(final Post post, final Member loginMember) { ); } - private static String convertImageUrl(final String imageUrl) { - return imageUrl.contains("없는사진") ? "" : imageUrl; - } - private static List getCategories(final List postCategories) { return postCategories.stream() .map(PostCategory::getCategory) diff --git a/backend/src/main/java/com/votogether/domain/post/dto/response/detail/PostOptionDetailResponse.java b/backend/src/main/java/com/votogether/domain/post/dto/response/detail/PostOptionDetailResponse.java index 89105e6f0..01adac12c 100644 --- a/backend/src/main/java/com/votogether/domain/post/dto/response/detail/PostOptionDetailResponse.java +++ b/backend/src/main/java/com/votogether/domain/post/dto/response/detail/PostOptionDetailResponse.java @@ -18,14 +18,10 @@ public static PostOptionDetailResponse of( return new PostOptionDetailResponse( postOption.getId(), postOption.getContent(), - convertImageUrl(postOption.getImageUrl()), + postOption.getImageUrl(), postOption.getVoteCount(isVisibleVoteResult), postOption.getVotePercent(totalVoteCount) ); } - private static String convertImageUrl(final String imageUrl) { - return imageUrl.contains("없는사진") ? "" : imageUrl; - } - }