Compare commits
No commits in common. "1629bc8bf73ed918c24b3aa830e84b6755ea4b57" and "7bb7e921377b042e7a15ba7a0a5380b70e9232e1" have entirely different histories.
1629bc8bf7
...
7bb7e92137
|
@ -150,14 +150,18 @@ class AudioContentService(
|
||||||
val theme = themeQueryRepository.findThemeByIdAndActive(id = request.themeId)
|
val theme = themeQueryRepository.findThemeByIdAndActive(id = request.themeId)
|
||||||
?: throw SodaException("잘못된 테마입니다. 다시 선택해 주세요.")
|
?: throw SodaException("잘못된 테마입니다. 다시 선택해 주세요.")
|
||||||
|
|
||||||
if (request.price <= 4) throw SodaException("콘텐츠의 최소금액은 5캔 입니다.")
|
if (request.price in 1..9) throw SodaException("콘텐츠의 최소금액은 10캔 입니다.")
|
||||||
|
|
||||||
// DB에 값 추가
|
// DB에 값 추가
|
||||||
val audioContent = AudioContent(
|
val audioContent = AudioContent(
|
||||||
title = request.title,
|
title = request.title,
|
||||||
detail = request.detail,
|
detail = request.detail,
|
||||||
type = request.type,
|
type = request.type,
|
||||||
price = request.price,
|
price = if (request.price < 0) {
|
||||||
|
0
|
||||||
|
} else {
|
||||||
|
request.price
|
||||||
|
},
|
||||||
isAdult = request.isAdult,
|
isAdult = request.isAdult,
|
||||||
isGeneratePreview = if (request.type == AudioContentType.INDIVIDUAL) {
|
isGeneratePreview = if (request.type == AudioContentType.INDIVIDUAL) {
|
||||||
request.isGeneratePreview
|
request.isGeneratePreview
|
||||||
|
|
|
@ -42,7 +42,7 @@ data class Order(
|
||||||
var audioContent: AudioContent? = null
|
var audioContent: AudioContent? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
can = if (type == OrderType.RENTAL) {
|
can = if (type == OrderType.RENTAL) {
|
||||||
ceil(value?.price!! * 0.6).toInt()
|
ceil(value?.price!! * 0.7).toInt()
|
||||||
} else {
|
} else {
|
||||||
value?.price!!
|
value?.price!!
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue