From 4c3fe2a08886b23229f2d127125e90d2192a1f8e Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 7 Jan 2026 11:07:35 +0900 Subject: [PATCH] =?UTF-8?q?AI=20=EC=BA=90=EB=A6=AD=ED=84=B0=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D/=EC=88=98=EC=A0=95=20API=EC=9D=98=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=ED=91=9C=EC=8B=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../character/AdminChatCharacterController.kt | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/chat/character/AdminChatCharacterController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/chat/character/AdminChatCharacterController.kt index 6c3143a5..62c0c50e 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/chat/character/AdminChatCharacterController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/chat/character/AdminChatCharacterController.kt @@ -124,7 +124,7 @@ class AdminChatCharacterController( // 외부 API 호출 전 DB에 동일한 이름이 있는지 조회 val existingCharacter = service.findByName(request.name) if (existingCharacter != null) { - throw SodaException(messageKey = "admin.chat.character.duplicate_name") + throw SodaException("동일한 이름은 등록이 불가능합니다: ${request.name}") } // 1. 외부 API 호출 @@ -244,7 +244,10 @@ class AdminChatCharacterController( return apiResponse.data?.id ?: throw SodaException(messageKey = "admin.chat.character.register_failed_no_id") } catch (e: Exception) { e.printStackTrace() - throw SodaException(messageKey = "admin.chat.character.register_failed_retry") + throw SodaException( + message = e.message, + messageKey = "admin.chat.character.register_failed_retry" + ) } } @@ -261,7 +264,10 @@ class AdminChatCharacterController( metadata = metadata ) } catch (e: Exception) { - throw SodaException(messageKey = "admin.chat.character.image_save_failed") + throw SodaException( + message = e.message, + messageKey = "admin.chat.character.image_save_failed" + ) } } @@ -307,13 +313,19 @@ class AdminChatCharacterController( // 외부 API로 전달할 변경이 있을 때만 외부 API 호출(3가지 필드만 변경된 경우는 호출하지 않음) if (hasChangedData) { val chatCharacter = service.findById(request.id) - ?: throw SodaException(messageKey = "admin.chat.character.not_found") + ?: throw SodaException( + message = "해당 ID의 캐릭터를 찾을 수 없습니다: ${request.id}", + messageKey = "admin.chat.character.not_found" + ) // 이름이 수정된 경우 DB에 동일한 이름이 있는지 확인 if (request.name != null && request.name != chatCharacter.name) { val existingCharacter = service.findByName(request.name) if (existingCharacter != null) { - throw SodaException(messageKey = "admin.chat.character.duplicate_name") + throw SodaException( + message = "동일한 이름은 등록이 불가능합니다: ${request.name}", + messageKey = "admin.chat.character.duplicate_name" + ) } } @@ -450,7 +462,10 @@ class AdminChatCharacterController( } } catch (e: Exception) { e.printStackTrace() - throw SodaException(messageKey = "admin.chat.character.update_failed_retry") + throw SodaException( + message = e.message, + messageKey = "admin.chat.character.update_failed_retry" + ) } } }