feat(can): 캔 응답 - String 형태 가격 필드 추가

This commit is contained in:
2025-10-02 15:07:57 +09:00
parent fb0a9e98a1
commit 2ab2a04748
3 changed files with 6 additions and 22 deletions

View File

@@ -26,7 +26,8 @@ class AdminCanQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : A
can1.can,
can1.rewardCan,
can1.price,
can1.currency
can1.currency,
can1.price.stringValue()
)
)
.from(can1)

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,24 +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,
can1.currency
)
)
.from(can1)
.where(can1.status.eq(status))
.orderBy(can1.can.asc())
.fetch()
}
override fun findAllByStatusAndCurrency(status: CanStatus, currency: String): List<CanResponse> {
return queryFactory
.select(
@@ -60,7 +41,8 @@ class CanQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : CanQue
can1.can,
can1.rewardCan,
can1.price,
can1.currency
can1.currency,
can1.price.stringValue()
)
)
.from(can1)

View File

@@ -9,5 +9,6 @@ data class CanResponse @QueryProjection constructor(
val can: Int,
val rewardCan: Int,
val price: BigDecimal,
val currency: String
val currency: String,
val priceStr: String
)