충전이벤트가 적용되지 않는 버그 수정

This commit is contained in:
Klaus 2023-08-27 20:58:03 +09:00
parent 9046c10d10
commit 2abfb8ce58
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import kr.co.vividnext.sodalive.member.auth.AuthRepository
import org.springframework.context.ApplicationEventPublisher import org.springframework.context.ApplicationEventPublisher
import org.springframework.data.repository.findByIdOrNull import org.springframework.data.repository.findByIdOrNull
import org.springframework.stereotype.Service import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import kotlin.math.ceil import kotlin.math.ceil
import kotlin.math.round import kotlin.math.round
@ -27,6 +28,7 @@ class ChargeEventService(
private val chargeEventRepository: ChargeEventRepository, private val chargeEventRepository: ChargeEventRepository,
private val applicationEventPublisher: ApplicationEventPublisher private val applicationEventPublisher: ApplicationEventPublisher
) { ) {
@Transactional
fun applyChargeEvent(chargeId: Long, memberId: Long) { fun applyChargeEvent(chargeId: Long, memberId: Long) {
val charge = chargeRepository.findByIdOrNull(chargeId) val charge = chargeRepository.findByIdOrNull(chargeId)
?: throw SodaException("결제정보에 오류가 있습니다.") ?: throw SodaException("결제정보에 오류가 있습니다.")