Skip to content

Commit

Permalink
feat : 북마크 조인조건 추가 (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlswns2480 authored Dec 2, 2024
1 parent 5aa0d02 commit 2253aeb
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ContentAdapter(
.from(contentEntity)
.leftJoin(userLogEntity).on(userLogEntity.contentId.eq(contentEntity.id))
.join(categoryEntity).on(categoryEntity.id.eq(contentEntity.categoryId))
.leftJoin(bookmarkEntity).on(bookmarkEntity.contentId.eq(contentEntity.id))
.leftJoin(bookmarkEntity).on(bookmarkEntity.contentId.eq(contentEntity.id).and(bookmarkEntity.deleted.isFalse))

FavoriteOrNot(condition.favorites, query) // 북마크 조인 여부

Expand All @@ -77,7 +77,6 @@ class ContentAdapter(
dateBetween(condition.startDate, condition.endDate),
categoryIn(condition.categoryIds),
containsWord(condition.searchWord),
bookmarkEntity.deleted.isFalse,
)
.offset(pageable.offset)
.groupBy(contentEntity)
Expand Down Expand Up @@ -105,12 +104,11 @@ class ContentAdapter(
.from(contentEntity)
.leftJoin(userLogEntity).on(userLogEntity.contentId.eq(contentEntity.id))
.join(categoryEntity).on(categoryEntity.id.eq(contentEntity.categoryId))
.leftJoin(bookmarkEntity).on(bookmarkEntity.contentId.eq(contentEntity.id))
.leftJoin(bookmarkEntity).on(bookmarkEntity.contentId.eq(contentEntity.id).and(bookmarkEntity.deleted.isFalse))
.where(
categoryEntity.userId.eq(userId),
categoryEntity.name.eq(categoryName),
contentEntity.deleted.isFalse,
bookmarkEntity.deleted.isFalse,
)
.offset(pageable.offset)
.groupBy(contentEntity)
Expand All @@ -137,12 +135,11 @@ class ContentAdapter(
.from(contentEntity)
.leftJoin(userLogEntity).on(userLogEntity.contentId.eq(contentEntity.id))
.join(categoryEntity).on(categoryEntity.id.eq(contentEntity.categoryId))
.leftJoin(bookmarkEntity).on(bookmarkEntity.contentId.eq(contentEntity.id))
.leftJoin(bookmarkEntity).on(bookmarkEntity.contentId.eq(contentEntity.id).and(bookmarkEntity.deleted.isFalse))
.where(
categoryEntity.userId.eq(userId),
contentEntity.deleted.isFalse,
bookmarkEntity.deleted.isFalse,
bookmarkEntity.deleted.isFalse,
)
.offset(pageable.offset)
.groupBy(contentEntity)
Expand Down

0 comments on commit 2253aeb

Please sign in to comment.