오디션 배역 등 메시지 다국어 처리

This commit is contained in:
2025-12-22 21:49:07 +09:00
parent 8785741855
commit 14d0ae9851
6 changed files with 97 additions and 21 deletions

View File

@@ -31,7 +31,7 @@ class AdminAuditionRoleService(
auditionScriptUrl = request.auditionScriptUrl
)
val audition = auditionRepository.findByIdOrNull(id = request.auditionId)
?: throw SodaException("잘못된 요청입니다.\n다시 시도해 주세요.")
?: throw SodaException(messageKey = "admin.audition.invalid_request_retry")
auditionRole.audition = audition
repository.save(auditionRole)
@@ -48,15 +48,19 @@ class AdminAuditionRoleService(
fun updateAuditionRole(image: MultipartFile?, requestString: String) {
val request = objectMapper.readValue(requestString, UpdateAuditionRoleRequest::class.java)
val auditionRole = repository.findByIdOrNull(id = request.id)
?: throw SodaException("잘못된 요청입니다.\n다시 시도해 주세요.")
?: throw SodaException(messageKey = "admin.audition.invalid_request_retry")
if (!request.name.isNullOrBlank()) {
if (request.name.length < 2) throw SodaException("배역 이름은 최소 2글자 입니다")
if (request.name.length < 2) {
throw SodaException(messageKey = "admin.audition.role.name_min_length")
}
auditionRole.name = request.name
}
if (!request.information.isNullOrBlank()) {
if (request.information.length < 10) throw SodaException("오디션 배역 정보는 최소 10글자 입니다")
if (request.information.length < 10) {
throw SodaException(messageKey = "admin.audition.role.information_min_length")
}
auditionRole.information = request.information
}

View File

@@ -10,19 +10,19 @@ data class CreateAuditionRoleRequest(
) {
init {
if (auditionId < 0) {
throw SodaException("캐릭터가 등록될 오디션을 선택하세요")
throw SodaException(messageKey = "admin.audition.role.audition_required")
}
if (name.isBlank() || name.length < 2) {
throw SodaException("캐릭터명을 입력하세요")
throw SodaException(messageKey = "admin.audition.role.name_required")
}
if (auditionScriptUrl.isBlank() || auditionScriptUrl.length < 10) {
throw SodaException("오디션 대본 URL을 입력하세요")
throw SodaException(messageKey = "admin.audition.role.script_url_required")
}
if (information.isBlank() || information.length < 10) {
throw SodaException("오디션 캐릭터 정보는 최소 10글자 입니다")
throw SodaException(messageKey = "admin.audition.role.information_required")
}
}
}

View File

@@ -13,7 +13,7 @@ data class UpdateAuditionRoleRequest(
) {
init {
if (id < 0) {
throw SodaException("잘못된 요청입니다.")
throw SodaException(messageKey = "common.error.invalid_request")
}
}
}