From ae9feffba876383478e60b4af0cf683382093f07 Mon Sep 17 00:00:00 2001 From: TaeyeonRoyce Date: Wed, 11 Sep 2024 16:53:56 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20=EC=9D=8C=EC=8B=9D=EC=A0=90=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=ED=8F=AC=ED=95=A8=ED=95=98=EC=97=AC=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=ED=95=98=EB=8F=84=EB=A1=9D=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 --- .../adapter/out/persistence/RestaurantPersistenceAdapter.kt | 4 +++- .../out/persistence/entity/RestaurantImageJpaRepository.kt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/celuveat/restaurant/adapter/out/persistence/RestaurantPersistenceAdapter.kt b/src/main/kotlin/com/celuveat/restaurant/adapter/out/persistence/RestaurantPersistenceAdapter.kt index f3dcdbea..31218478 100644 --- a/src/main/kotlin/com/celuveat/restaurant/adapter/out/persistence/RestaurantPersistenceAdapter.kt +++ b/src/main/kotlin/com/celuveat/restaurant/adapter/out/persistence/RestaurantPersistenceAdapter.kt @@ -46,7 +46,9 @@ class RestaurantPersistenceAdapter( } override fun readById(id: Long): Restaurant { - return restaurantPersistenceMapper.toDomainWithoutImage(restaurantJpaRepository.getById(id)) + val restaurant = restaurantJpaRepository.getById(id) + val images = restaurantImageJpaRepository.findByRestaurant(restaurant) + return restaurantPersistenceMapper.toDomain(restaurant, images) } override fun readCelebrityRecommendRestaurant(): List { diff --git a/src/main/kotlin/com/celuveat/restaurant/adapter/out/persistence/entity/RestaurantImageJpaRepository.kt b/src/main/kotlin/com/celuveat/restaurant/adapter/out/persistence/entity/RestaurantImageJpaRepository.kt index 2a64637c..9a21318d 100644 --- a/src/main/kotlin/com/celuveat/restaurant/adapter/out/persistence/entity/RestaurantImageJpaRepository.kt +++ b/src/main/kotlin/com/celuveat/restaurant/adapter/out/persistence/entity/RestaurantImageJpaRepository.kt @@ -4,4 +4,6 @@ import org.springframework.data.jpa.repository.JpaRepository interface RestaurantImageJpaRepository : JpaRepository { fun findByRestaurantIn(restaurants: List): List + + fun findByRestaurant(restaurant: RestaurantJpaEntity): List }