fix(chat-character-image): 캐릭터 이미지 가격

- 이미지 단독 구매 가격과 메시지를 통한 구매 가겨으로 분리
This commit is contained in:
2025-08-21 04:07:25 +09:00
parent c8841856c0
commit 8451cdfb80
4 changed files with 19 additions and 8 deletions

View File

@@ -21,8 +21,11 @@ class CharacterImage(
// 블러 이미지 경로 (S3 key - free/public bucket)
var blurImagePath: String,
// 가격 (메시지/이미지 통합 단일가 - 요구사항 범위)
var price: Long = 0L,
// 이미지 단독 구매 가격 (단위: can)
var imagePriceCan: Long = 0L,
// 메시지를 통한 가격 (단위: can)
var messagePriceCan: Long = 0L,
// 성인 이미지 여부 (본인인증 필요)
var isAdult: Boolean = false,

View File

@@ -24,13 +24,16 @@ class CharacterImageService(
characterId: Long,
imagePath: String,
blurImagePath: String,
price: Long,
imagePriceCan: Long,
messagePriceCan: Long,
isAdult: Boolean,
triggers: List<String>
): CharacterImage {
val character = characterRepository.findById(characterId)
.orElseThrow { SodaException("캐릭터를 찾을 수 없습니다: $characterId") }
if (imagePriceCan < 0 || messagePriceCan < 0) throw SodaException("가격은 0 can 이상이어야 합니다.")
if (!character.isActive) throw SodaException("비활성화된 캐릭터에는 이미지를 등록할 수 없습니다: $characterId")
val nextOrder = (imageRepository.findMaxSortOrderByCharacterId(characterId)) + 1
@@ -38,7 +41,8 @@ class CharacterImageService(
chatCharacter = character,
imagePath = imagePath,
blurImagePath = blurImagePath,
price = price,
imagePriceCan = imagePriceCan,
messagePriceCan = messagePriceCan,
isAdult = isAdult,
sortOrder = nextOrder,
isActive = true