Skip to content

Commit

Permalink
Merge pull request #25 from kea-dpang/develop
Browse files Browse the repository at this point in the history
!HOTFIX: 마일리지 삭제 로직 수정
  • Loading branch information
namsh1125 authored Feb 4, 2024
2 parents 48feed9 + add2b0e commit 7e4f04f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository

@Repository
interface ChargeRequestRepository : JpaRepository<ChargeRequest, Long>, ChargeRequestRepositoryCustom
interface ChargeRequestRepository : JpaRepository<ChargeRequest, Long>, ChargeRequestRepositoryCustom {

fun findByUserId(userId: Long): List<ChargeRequest>
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ class MileageServiceImpl(
logger.info("마일리지 삭제 요청 시작, 사용자 ID: $userId")

if (mileageRepository.existsById(userId)) {
val chargeRequests = chargeRequestRepository.findByUserId(userId)
chargeRequestRepository.deleteAll(chargeRequests)
logger.info("사용자(${userId})의 마일리지 충전 요청 삭제 완료")

mileageRepository.deleteById(userId)
logger.info("사용자(${userId})의 마일리지 삭제 완료")

logger.info("마일리지 삭제 요청 완료, 삭제된 사용자 ID: $userId")

} else {
Expand Down

0 comments on commit 7e4f04f

Please sign in to comment.