캐릭터 챗봇 #338
|
@ -81,7 +81,8 @@ class AdminCharacterImageController(
|
||||||
characterId = request.characterId,
|
characterId = request.characterId,
|
||||||
imagePath = imagePath,
|
imagePath = imagePath,
|
||||||
blurImagePath = blurImagePath,
|
blurImagePath = blurImagePath,
|
||||||
price = request.price,
|
imagePriceCan = request.imagePriceCan,
|
||||||
|
messagePriceCan = request.messagePriceCan,
|
||||||
isAdult = request.isAdult,
|
isAdult = request.isAdult,
|
||||||
triggers = request.triggers ?: emptyList()
|
triggers = request.triggers ?: emptyList()
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,8 @@ import kr.co.vividnext.sodalive.chat.character.image.CharacterImage
|
||||||
|
|
||||||
data class RegisterCharacterImageRequest(
|
data class RegisterCharacterImageRequest(
|
||||||
@JsonProperty("characterId") val characterId: Long,
|
@JsonProperty("characterId") val characterId: Long,
|
||||||
@JsonProperty("price") val price: Long,
|
@JsonProperty("imagePriceCan") val imagePriceCan: Long,
|
||||||
|
@JsonProperty("messagePriceCan") val messagePriceCan: Long,
|
||||||
@JsonProperty("isAdult") val isAdult: Boolean = false,
|
@JsonProperty("isAdult") val isAdult: Boolean = false,
|
||||||
@JsonProperty("triggers") val triggers: List<String>? = null
|
@JsonProperty("triggers") val triggers: List<String>? = null
|
||||||
)
|
)
|
||||||
|
@ -26,7 +27,8 @@ data class UpdateCharacterImageOrdersRequest(
|
||||||
data class AdminCharacterImageResponse(
|
data class AdminCharacterImageResponse(
|
||||||
val id: Long,
|
val id: Long,
|
||||||
val characterId: Long,
|
val characterId: Long,
|
||||||
val price: Long,
|
val imagePriceCan: Long,
|
||||||
|
val messagePriceCan: Long,
|
||||||
val isAdult: Boolean,
|
val isAdult: Boolean,
|
||||||
val sortOrder: Int,
|
val sortOrder: Int,
|
||||||
val active: Boolean,
|
val active: Boolean,
|
||||||
|
@ -42,7 +44,8 @@ data class AdminCharacterImageResponse(
|
||||||
return AdminCharacterImageResponse(
|
return AdminCharacterImageResponse(
|
||||||
id = entity.id!!,
|
id = entity.id!!,
|
||||||
characterId = entity.chatCharacter.id!!,
|
characterId = entity.chatCharacter.id!!,
|
||||||
price = entity.price,
|
imagePriceCan = entity.imagePriceCan,
|
||||||
|
messagePriceCan = entity.messagePriceCan,
|
||||||
isAdult = entity.isAdult,
|
isAdult = entity.isAdult,
|
||||||
sortOrder = entity.sortOrder,
|
sortOrder = entity.sortOrder,
|
||||||
active = entity.isActive,
|
active = entity.isActive,
|
||||||
|
|
|
@ -21,8 +21,11 @@ class CharacterImage(
|
||||||
// 블러 이미지 경로 (S3 key - free/public bucket)
|
// 블러 이미지 경로 (S3 key - free/public bucket)
|
||||||
var blurImagePath: String,
|
var blurImagePath: String,
|
||||||
|
|
||||||
// 가격 (메시지/이미지 통합 단일가 - 요구사항 범위)
|
// 이미지 단독 구매 가격 (단위: can)
|
||||||
var price: Long = 0L,
|
var imagePriceCan: Long = 0L,
|
||||||
|
|
||||||
|
// 메시지를 통한 가격 (단위: can)
|
||||||
|
var messagePriceCan: Long = 0L,
|
||||||
|
|
||||||
// 성인 이미지 여부 (본인인증 필요)
|
// 성인 이미지 여부 (본인인증 필요)
|
||||||
var isAdult: Boolean = false,
|
var isAdult: Boolean = false,
|
||||||
|
|
|
@ -24,13 +24,16 @@ class CharacterImageService(
|
||||||
characterId: Long,
|
characterId: Long,
|
||||||
imagePath: String,
|
imagePath: String,
|
||||||
blurImagePath: String,
|
blurImagePath: String,
|
||||||
price: Long,
|
imagePriceCan: Long,
|
||||||
|
messagePriceCan: Long,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
triggers: List<String>
|
triggers: List<String>
|
||||||
): CharacterImage {
|
): CharacterImage {
|
||||||
val character = characterRepository.findById(characterId)
|
val character = characterRepository.findById(characterId)
|
||||||
.orElseThrow { SodaException("캐릭터를 찾을 수 없습니다: $characterId") }
|
.orElseThrow { SodaException("캐릭터를 찾을 수 없습니다: $characterId") }
|
||||||
|
|
||||||
|
if (imagePriceCan < 0 || messagePriceCan < 0) throw SodaException("가격은 0 can 이상이어야 합니다.")
|
||||||
|
|
||||||
if (!character.isActive) throw SodaException("비활성화된 캐릭터에는 이미지를 등록할 수 없습니다: $characterId")
|
if (!character.isActive) throw SodaException("비활성화된 캐릭터에는 이미지를 등록할 수 없습니다: $characterId")
|
||||||
|
|
||||||
val nextOrder = (imageRepository.findMaxSortOrderByCharacterId(characterId)) + 1
|
val nextOrder = (imageRepository.findMaxSortOrderByCharacterId(characterId)) + 1
|
||||||
|
@ -38,7 +41,8 @@ class CharacterImageService(
|
||||||
chatCharacter = character,
|
chatCharacter = character,
|
||||||
imagePath = imagePath,
|
imagePath = imagePath,
|
||||||
blurImagePath = blurImagePath,
|
blurImagePath = blurImagePath,
|
||||||
price = price,
|
imagePriceCan = imagePriceCan,
|
||||||
|
messagePriceCan = messagePriceCan,
|
||||||
isAdult = isAdult,
|
isAdult = isAdult,
|
||||||
sortOrder = nextOrder,
|
sortOrder = nextOrder,
|
||||||
isActive = true
|
isActive = true
|
||||||
|
|
Loading…
Reference in New Issue