From b5ce264eb0d18e743a811656b4f8a9be776967db Mon Sep 17 00:00:00 2001 From: jainefer Date: Sun, 22 Dec 2024 17:51:35 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20toPost=20user=20=EA=B0=92=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 --- .../apiserver/api/borrowPosts/converter/PostsConverter.java | 6 +++--- .../apiserver/api/borrowPosts/service/PostsServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/site/billbill/apiserver/api/borrowPosts/converter/PostsConverter.java b/src/main/java/site/billbill/apiserver/api/borrowPosts/converter/PostsConverter.java index 831e18d..aadebeb 100644 --- a/src/main/java/site/billbill/apiserver/api/borrowPosts/converter/PostsConverter.java +++ b/src/main/java/site/billbill/apiserver/api/borrowPosts/converter/PostsConverter.java @@ -98,7 +98,7 @@ public static PostsResponse.ReviewResponse toReview(ItemsReviewJpaEntity review) public static PostsResponse.ReviewsResponse toReviews(List reviews){ return PostsResponse.ReviewsResponse.builder().reviews(reviews).build(); } - public static PostsResponse.ViewPostResponse toViewPost(ItemsJpaEntity item, ItemsBorrowJpaEntity borrowItem, String status,UserJpaEntity user){ + public static PostsResponse.ViewPostResponse toViewPost(ItemsJpaEntity item, ItemsBorrowJpaEntity borrowItem, String status){ return PostsResponse.ViewPostResponse.builder() .postId(item.getId()) .title(item.getTitle()) @@ -110,8 +110,8 @@ public static PostsResponse.ViewPostResponse toViewPost(ItemsJpaEntity item, Ite .itemStatus(status) .categoryId(item.getCategory().getId()) .categoryName(item.getCategory().getName()) - .userId(user.getUserId()) - .userName(user.getNickname()) + .userId(item.getOwner().getUserId()) + .userName(item.getOwner().getNickname()) .build(); } public static PostsResponse.NoRentalPeriodResponse toOwnerNoRentalPeriod(ItemsBorrowStatusJpaEntity borrowStatus){ diff --git a/src/main/java/site/billbill/apiserver/api/borrowPosts/service/PostsServiceImpl.java b/src/main/java/site/billbill/apiserver/api/borrowPosts/service/PostsServiceImpl.java index 66cbb35..db90d1f 100644 --- a/src/main/java/site/billbill/apiserver/api/borrowPosts/service/PostsServiceImpl.java +++ b/src/main/java/site/billbill/apiserver/api/borrowPosts/service/PostsServiceImpl.java @@ -119,7 +119,7 @@ public PostsResponse.ViewPostResponse ViewPostService(String postId, String user break; } - return PostsConverter.toViewPost(item, borrowItem, status, user); + return PostsConverter.toViewPost(item, borrowItem, status); }