fix(can-list): 국가별로 통화가 표시되도록 수정

This commit is contained in:
2025-10-10 14:32:12 +09:00
parent 36e20bf0d1
commit 41183b4648
2 changed files with 1 additions and 21 deletions

View File

@@ -23,7 +23,6 @@ import org.springframework.stereotype.Repository
interface CanRepository : JpaRepository<Can, Long>, CanQueryRepository
interface CanQueryRepository {
fun findAllByStatus(status: CanStatus): List<CanResponse>
fun findAllByStatusAndCurrency(status: CanStatus, currency: String): List<CanResponse>
fun getCanUseStatus(member: Member, pageable: Pageable): List<UseCan>
fun getCanChargeStatus(member: Member, pageable: Pageable, container: String): List<Charge>
@@ -33,25 +32,6 @@ interface CanQueryRepository {
@Repository
class CanQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : CanQueryRepository {
override fun findAllByStatus(status: CanStatus): List<CanResponse> {
return queryFactory
.select(
QCanResponse(
can1.id,
can1.title,
can1.can,
can1.rewardCan,
can1.price.intValue(),
can1.currency,
can1.price.stringValue()
)
)
.from(can1)
.where(can1.status.eq(status))
.orderBy(can1.currency.asc(), can1.can.asc())
.fetch()
}
override fun findAllByStatusAndCurrency(status: CanStatus, currency: String): List<CanResponse> {
return queryFactory
.select(

View File

@@ -17,7 +17,7 @@ class CanService(private val repository: CanRepository) {
GeoCountry.KR -> "KRW"
else -> "USD"
}
return repository.findAllByStatus(status = CanStatus.SALE)
return repository.findAllByStatusAndCurrency(status = CanStatus.SALE, currency = currency)
}
fun getCanStatus(member: Member, container: String): GetCanStatusResponse {