Skip to content

Commit

Permalink
[KAN-000] 음식점 중복 데이터 발생 해소
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkyoungdeok committed Jun 3, 2024
1 parent 1fe411b commit fed2d86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class RestaurantRepositoryCustomImpl(
restaurantLike.restaurantId.eq(restaurantId)
.and(restaurantLike.userId.eq(userId))
)
.distinct()
.fetch()

val menus = queryFactory
Expand All @@ -54,6 +55,7 @@ class RestaurantRepositoryCustomImpl(
.from(restaurantCategory)
.leftJoin(category).on(restaurantCategory.categoryId.eq(category.id))
.where(restaurantCategory.restaurantId.eq(restaurantId))
.distinct()
.fetch()

return if (restaurantInfo != null) {
Expand Down Expand Up @@ -107,6 +109,7 @@ class RestaurantRepositoryCustomImpl(
.from(restaurantCategory)
.leftJoin(category).on(restaurantCategory.categoryId.eq(category.id))
.where(restaurantCategory.restaurantId.`in`(restaurantIds))
.distinct()
.fetch()

val restaurantDtos = restaurantInfos.map { restaurantInfo ->
Expand Down Expand Up @@ -155,6 +158,7 @@ class RestaurantRepositoryCustomImpl(
.fetchJoin()
.offset(pageable.offset)
.limit(pageable.pageSize.toLong())
.distinct()
.fetch()

val menus = queryFactory
Expand All @@ -175,6 +179,7 @@ class RestaurantRepositoryCustomImpl(
.from(restaurantCategory)
.leftJoin(category).on(restaurantCategory.categoryId.eq(category.id))
.where(restaurantCategory.restaurantId.`in`(restaurantIds))
.distinct()
.fetch()

val restaurantDtos = restaurantInfos.map { restaurantInfo ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ReviewRepositoryCustomImpl(
.and(reviewLike.userId.eq(user.id))
)
.where(review.id.eq(reviewId))
.distinct()
.fetchOne()
}

Expand Down Expand Up @@ -66,6 +67,7 @@ class ReviewRepositoryCustomImpl(
.limit(pageable.pageSize.toLong())
.orderBy(*orderSpecifier.toTypedArray())
.fetchJoin()
.distinct()
.fetch()

return PageImpl(
Expand Down Expand Up @@ -102,6 +104,7 @@ class ReviewRepositoryCustomImpl(
.limit(pageable.pageSize.toLong())
.orderBy(*orderSpecifier.toTypedArray())
.fetchJoin()
.distinct()
.fetch()

return PageImpl(
Expand Down

0 comments on commit fed2d86

Please sign in to comment.