다국어 메시지 분리 적용

This commit is contained in:
2025-12-23 16:19:04 +09:00
parent 39d13ab7c3
commit f429ffbbbe
7 changed files with 138 additions and 42 deletions

View File

@@ -78,7 +78,9 @@ class EventService(
startDateString: String,
endDateString: String
): Long {
if (detail == null && link.isNullOrBlank()) throw SodaException("상세이미지 혹은 링크를 등록하세요")
if (detail == null && link.isNullOrBlank()) {
throw SodaException(messageKey = "event.detail_or_link_required")
}
val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
val startDate = LocalDate.parse(startDateString, dateTimeFormatter).atTime(0, 0)
@@ -146,7 +148,7 @@ class EventService(
event.detailImage = detailImagePath
event.popupImage = popupImagePath
return event.id ?: throw SodaException("이벤트 등록을 하지 못했습니다.")
return event.id ?: throw SodaException(messageKey = "event.save_failed")
}
@Transactional
@@ -162,10 +164,10 @@ class EventService(
startDateString: String? = null,
endDateString: String? = null
) {
if (id <= 0) throw SodaException("잘못된 요청입니다.")
if (id <= 0) throw SodaException(messageKey = "common.error.invalid_request")
val event = repository.findByIdOrNull(id)
?: throw SodaException("잘못된 요청입니다.")
?: throw SodaException(messageKey = "common.error.invalid_request")
if (thumbnail != null) {
val metadata = ObjectMetadata()
@@ -234,9 +236,9 @@ class EventService(
@Transactional
fun delete(id: Long) {
if (id <= 0) throw SodaException("잘못된 요청입니다.")
if (id <= 0) throw SodaException(messageKey = "common.error.invalid_request")
val event = repository.findByIdOrNull(id)
?: throw SodaException("잘못된 요청입니다.")
?: throw SodaException(messageKey = "common.error.invalid_request")
event.isActive = false
}