Skip to content

Commit

Permalink
refactor: 상품 페이징 조회 조건에 displaySataus.eq(DisplayStatus.VISIBLE) 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Ogu1208 committed Aug 17, 2024
1 parent 1201a86 commit 6218342
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.springframework.data.support.PageableExecutionUtils
import org.springframework.stereotype.Component
import org.store.clothstar.product.domain.Product
import org.store.clothstar.product.domain.QProduct.product
import org.store.clothstar.product.domain.type.DisplayStatus
import java.util.function.LongSupplier

@Component
Expand Down Expand Up @@ -57,6 +58,7 @@ class ProductRepositoryCustomImpl(
.from(product)
.where(
product.deletedAt.isNull()
.and(product.displayStatus.eq(DisplayStatus.VISIBLE))
.and(getSearchCondition(keyword))
)
.orderBy(*orderSpecifiers.toTypedArray()) // * -> 스프레드 연산자 : 배열의 각 요소를 개별 인자로 전달
Expand Down Expand Up @@ -84,6 +86,7 @@ class ProductRepositoryCustomImpl(
.where(
product.categoryId.eq(categoryId)
.and(product.deletedAt.isNull())
.and(product.displayStatus.eq(DisplayStatus.VISIBLE))
.and(getSearchCondition(keyword))
)

Expand Down Expand Up @@ -120,6 +123,7 @@ class ProductRepositoryCustomImpl(
.where(
product.categoryId.eq(categoryId)
.and(product.deletedAt.isNull())
.and(product.displayStatus.eq(DisplayStatus.VISIBLE))
.and(getSearchCondition(keyword))
)
.orderBy(*orderSpecifiers.toTypedArray())
Expand Down

0 comments on commit 6218342

Please sign in to comment.