refactor(admin-charge): 충전 상세 응답 QueryProjection 조회로 구조를 단순화한다
This commit is contained in:
@@ -88,7 +88,7 @@ class AdminChargeStatusQueryRepository(private val queryFactory: JPAQueryFactory
|
||||
endDate: LocalDateTime,
|
||||
paymentGateway: PaymentGateway,
|
||||
currency: String? = null
|
||||
): List<GetChargeStatusDetailQueryDto> {
|
||||
): List<GetChargeStatusDetailResponse> {
|
||||
val formattedDate = Expressions.stringTemplate(
|
||||
"DATE_FORMAT({0}, {1})",
|
||||
Expressions.dateTimeTemplate(
|
||||
@@ -117,7 +117,7 @@ class AdminChargeStatusQueryRepository(private val queryFactory: JPAQueryFactory
|
||||
|
||||
return queryFactory
|
||||
.select(
|
||||
QGetChargeStatusDetailQueryDto(
|
||||
QGetChargeStatusDetailResponse(
|
||||
charge.id,
|
||||
member.nickname,
|
||||
payment.method.coalesce(""),
|
||||
|
||||
@@ -44,15 +44,5 @@ class AdminChargeStatusService(val repository: AdminChargeStatusQueryRepository)
|
||||
.toLocalDateTime()
|
||||
|
||||
return repository.getChargeStatusDetail(startDate, endDate, paymentGateway, currency)
|
||||
.map {
|
||||
GetChargeStatusDetailResponse(
|
||||
chargeId = it.chargeId,
|
||||
nickname = it.nickname,
|
||||
method = it.method,
|
||||
amount = it.amount,
|
||||
locale = it.locale,
|
||||
datetime = it.datetime
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package kr.co.vividnext.sodalive.admin.charge
|
||||
|
||||
import com.querydsl.core.annotations.QueryProjection
|
||||
import java.math.BigDecimal
|
||||
|
||||
data class GetChargeStatusDetailQueryDto @QueryProjection constructor(
|
||||
val chargeId: Long,
|
||||
val nickname: String,
|
||||
val method: String,
|
||||
val amount: BigDecimal,
|
||||
val locale: String,
|
||||
val datetime: String
|
||||
)
|
||||
@@ -1,8 +1,9 @@
|
||||
package kr.co.vividnext.sodalive.admin.charge
|
||||
|
||||
import com.querydsl.core.annotations.QueryProjection
|
||||
import java.math.BigDecimal
|
||||
|
||||
data class GetChargeStatusDetailResponse(
|
||||
data class GetChargeStatusDetailResponse @QueryProjection constructor(
|
||||
val chargeId: Long,
|
||||
val nickname: String,
|
||||
val method: String,
|
||||
|
||||
Reference in New Issue
Block a user