feat(admin-content): 관리자 콘텐츠 개별 정산 요율 수정을 지원한다
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -110,6 +110,7 @@ class AdminAudioContentQueryRepositoryImpl(
|
||||
audioContentTheme.theme,
|
||||
audioContentTheme.id,
|
||||
audioContent.price,
|
||||
audioContent.settlementRatio,
|
||||
audioContent.limited,
|
||||
audioContent.remaining,
|
||||
audioContent.isAdult,
|
||||
|
||||
@@ -93,7 +93,8 @@ class AdminContentService(
|
||||
|
||||
@Transactional
|
||||
fun updateAudioContent(coverImage: MultipartFile?, requestString: String) {
|
||||
val request = objectMapper.readValue(requestString, UpdateAdminContentRequest::class.java)
|
||||
val requestNode = objectMapper.readTree(requestString)
|
||||
val request = objectMapper.treeToValue(requestNode, UpdateAdminContentRequest::class.java)
|
||||
val audioContent = repository.findByIdOrNull(id = request.id)
|
||||
?: throw SodaException(messageKey = "admin.content.not_found")
|
||||
|
||||
@@ -145,6 +146,18 @@ class AdminContentService(
|
||||
val theme = themeRepository.findByIdAndActive(id = request.themeId)
|
||||
audioContent.theme = theme
|
||||
}
|
||||
|
||||
if (request.isSettlementRatioDeleted == true) {
|
||||
if (requestNode.has("settlementRatio")) {
|
||||
throw SodaException(messageKey = "common.error.invalid_request")
|
||||
}
|
||||
audioContent.settlementRatio = null
|
||||
} else if (request.settlementRatio != null) {
|
||||
if (request.settlementRatio !in 0..100) {
|
||||
throw SodaException(messageKey = "common.error.invalid_request")
|
||||
}
|
||||
audioContent.settlementRatio = request.settlementRatio
|
||||
}
|
||||
}
|
||||
|
||||
fun getContentMainTabList(): List<GetContentMainTabItem> {
|
||||
|
||||
@@ -18,6 +18,7 @@ data class GetAdminContentListItem @QueryProjection constructor(
|
||||
val theme: String,
|
||||
val themeId: Long,
|
||||
val price: Int,
|
||||
val settlementRatio: Int?,
|
||||
val totalContentCount: Int?,
|
||||
val remainingContentCount: Int?,
|
||||
val isAdult: Boolean,
|
||||
|
||||
@@ -7,6 +7,8 @@ data class UpdateAdminContentRequest(
|
||||
val detail: String?,
|
||||
val curationId: Long?,
|
||||
val themeId: Long?,
|
||||
val settlementRatio: Int?,
|
||||
val isSettlementRatioDeleted: Boolean?,
|
||||
val isAdult: Boolean?,
|
||||
val isActive: Boolean?,
|
||||
val isCommentAvailable: Boolean?
|
||||
|
||||
@@ -35,6 +35,7 @@ data class AudioContent(
|
||||
var languageCode: String?,
|
||||
var playCount: Long = 0,
|
||||
var price: Int = 0,
|
||||
var settlementRatio: Int? = null,
|
||||
var releaseDate: LocalDateTime? = null,
|
||||
val limited: Int? = null,
|
||||
var remaining: Int? = null,
|
||||
|
||||
Reference in New Issue
Block a user