From d7e5999229ca75569c5ebfe85f88f108db7d987e Mon Sep 17 00:00:00 2001 From: jeongyeon0208 Date: Wed, 18 Dec 2024 14:38:00 +0900 Subject: [PATCH] =?UTF-8?q?#231=20Refactor:=20=EC=99=80=EC=9D=B8=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EC=A1=B0=ED=9A=8C=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/drinkeg/drinkeg/wine/controller/WineController.java | 4 +--- .../java/com/drinkeg/drinkeg/wine/service/WineService.java | 2 +- .../com/drinkeg/drinkeg/wine/service/WineServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/drinkeg/drinkeg/wine/controller/WineController.java b/src/main/java/com/drinkeg/drinkeg/wine/controller/WineController.java index def4934..e543330 100644 --- a/src/main/java/com/drinkeg/drinkeg/wine/controller/WineController.java +++ b/src/main/java/com/drinkeg/drinkeg/wine/controller/WineController.java @@ -4,7 +4,6 @@ import com.drinkeg.drinkeg.apipayLoad.ApiResponse; import com.drinkeg.drinkeg.wine.dto.response.SearchWineResponseDTO; import com.drinkeg.drinkeg.wine.dto.response.WineResponseWithThreeReviewsDTO; -import com.drinkeg.drinkeg.wine.dto.response.WineReviewDTO; import com.drinkeg.drinkeg.dto.loginDTO.commonDTO.PrincipalDetail; import com.drinkeg.drinkeg.wine.dto.response.WineReviewResponseDTO; import com.drinkeg.drinkeg.wine.service.WineService; @@ -50,8 +49,7 @@ public ApiResponse showWine(@AuthenticationPrin public ApiResponse showWineReview(@AuthenticationPrincipal PrincipalDetail principalDetail, @PathVariable("wineId") Long wineId, @RequestParam Boolean orderByLatest) { - WineReviewResponseDTO wineReviewResponseDTO = wineService.getWineReviewsByWineId(wineId, principalDetail, orderByLatest); - + WineReviewResponseDTO wineReviewResponseDTO = wineService.getWineReviewsAndIsLikedByWineId(wineId, principalDetail, orderByLatest); return ApiResponse.onSuccess(wineReviewResponseDTO); } diff --git a/src/main/java/com/drinkeg/drinkeg/wine/service/WineService.java b/src/main/java/com/drinkeg/drinkeg/wine/service/WineService.java index e051323..e7e58f4 100644 --- a/src/main/java/com/drinkeg/drinkeg/wine/service/WineService.java +++ b/src/main/java/com/drinkeg/drinkeg/wine/service/WineService.java @@ -16,7 +16,7 @@ public interface WineService { public WineResponseWithThreeReviewsDTO getWineResponseByWineId(Long wineId, PrincipalDetail principalDetail); - public WineReviewResponseDTO getWineReviewsByWineId(Long wineId, PrincipalDetail principalDetail, boolean orderByLatest); + public WineReviewResponseDTO getWineReviewsAndIsLikedByWineId(Long wineId, PrincipalDetail principalDetail, boolean orderByLatest); public HomeResponseDTO getHomeResponse(PrincipalDetail principalDetail); diff --git a/src/main/java/com/drinkeg/drinkeg/wine/service/WineServiceImpl.java b/src/main/java/com/drinkeg/drinkeg/wine/service/WineServiceImpl.java index 33288dd..4993fc7 100644 --- a/src/main/java/com/drinkeg/drinkeg/wine/service/WineServiceImpl.java +++ b/src/main/java/com/drinkeg/drinkeg/wine/service/WineServiceImpl.java @@ -63,7 +63,7 @@ public WineResponseWithThreeReviewsDTO getWineResponseByWineId(Long wineId, Prin } @Override - public WineReviewResponseDTO getWineReviewsByWineId(Long wineId, PrincipalDetail principalDetail, boolean orderByLatest){ + public WineReviewResponseDTO getWineReviewsAndIsLikedByWineId(Long wineId, PrincipalDetail principalDetail, boolean orderByLatest){ // 회원을 조회한다. Member member = memberRepository.findByUsername(principalDetail.getUsername()).orElseThrow( () -> new GeneralException(ErrorStatus.MEMBER_NOT_FOUND));