콘텐츠 메시지 다국어 처리

This commit is contained in:
2025-12-23 19:03:38 +09:00
parent 9d619450ef
commit e987a56544
10 changed files with 303 additions and 76 deletions

View File

@@ -18,7 +18,7 @@ class AudioContentDonationController(private val service: AudioContentDonationSe
@RequestBody request: AudioContentDonationRequest,
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
) = run {
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
if (member == null) throw SodaException(messageKey = "common.error.bad_credentials")
ApiResponse.ok(service.donation(request = request, member = member))
}

View File

@@ -22,11 +22,11 @@ class AudioContentDonationService(
) {
@Transactional
fun donation(request: AudioContentDonationRequest, member: Member) {
if (request.donationCan < 1) throw SodaException("1캔 이상 후원하실 수 있습니다.")
if (request.comment.isBlank()) throw SodaException("함께 보낼 메시지를 입력하세요.")
if (request.donationCan < 1) throw SodaException(messageKey = "content.donation.error.minimum_can")
if (request.comment.isBlank()) throw SodaException(messageKey = "content.donation.error.comment_required")
val audioContent = queryRepository.findByIdAndActive(request.contentId)
?: throw SodaException("잘못된 콘텐츠 입니다.\n다시 시도해 주세요.")
?: throw SodaException(messageKey = "content.error.invalid_content_retry")
canPaymentService.spendCan(
memberId = member.id!!,