parent
6e6b27bb65
commit
8cfe9ade9a
|
@ -53,6 +53,7 @@ class AdminAuditionRoleQueryRepositoryImpl(
|
|||
QGetAuditionRoleDetailResponse(
|
||||
auditionRole.name,
|
||||
auditionRole.imagePath.prepend("/").prepend(cloudfrontHost),
|
||||
auditionRole.information,
|
||||
auditionRole.auditionScriptUrl
|
||||
)
|
||||
)
|
||||
|
|
|
@ -25,7 +25,11 @@ class AdminAuditionRoleService(
|
|||
@Transactional
|
||||
fun createAuditionRole(image: MultipartFile, requestString: String) {
|
||||
val request = objectMapper.readValue(requestString, CreateAuditionRoleRequest::class.java)
|
||||
val auditionRole = AuditionRole(name = request.name, auditionScriptUrl = request.auditionScriptUrl)
|
||||
val auditionRole = AuditionRole(
|
||||
name = request.name,
|
||||
information = request.information,
|
||||
auditionScriptUrl = request.auditionScriptUrl
|
||||
)
|
||||
val audition = auditionRepository.findByIdOrNull(id = request.auditionId)
|
||||
?: throw SodaException("잘못된 요청입니다.\n다시 시도해 주세요.")
|
||||
auditionRole.audition = audition
|
||||
|
@ -50,6 +54,10 @@ class AdminAuditionRoleService(
|
|||
auditionRole.name = request.name
|
||||
}
|
||||
|
||||
if (!request.information.isNullOrBlank() && request.information.length >= 10) {
|
||||
auditionRole.information = request.information
|
||||
}
|
||||
|
||||
if (!request.auditionScriptUrl.isNullOrBlank()) {
|
||||
auditionRole.auditionScriptUrl = request.auditionScriptUrl
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import kr.co.vividnext.sodalive.common.SodaException
|
|||
data class CreateAuditionRoleRequest(
|
||||
val auditionId: Long,
|
||||
val name: String,
|
||||
val information: String,
|
||||
val auditionScriptUrl: String
|
||||
) {
|
||||
init {
|
||||
|
@ -19,5 +20,9 @@ data class CreateAuditionRoleRequest(
|
|||
if (auditionScriptUrl.isBlank() || auditionScriptUrl.length < 10) {
|
||||
throw SodaException("오디션 대본 URL을 입력하세요")
|
||||
}
|
||||
|
||||
if (information.isBlank() || information.length < 10) {
|
||||
throw SodaException("오디션 캐릭터 정보는 최소 10글자 입니다")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@ import com.querydsl.core.annotations.QueryProjection
|
|||
data class GetAuditionRoleDetailResponse @QueryProjection constructor(
|
||||
val name: String,
|
||||
val imageUrl: String,
|
||||
val information: String,
|
||||
val auditionScriptUrl: String
|
||||
)
|
||||
|
|
|
@ -6,6 +6,7 @@ import kr.co.vividnext.sodalive.common.SodaException
|
|||
data class UpdateAuditionRoleRequest(
|
||||
val id: Long,
|
||||
val name: String? = null,
|
||||
val information: String? = null,
|
||||
val auditionScriptUrl: String? = null,
|
||||
val status: AuditionStatus? = null,
|
||||
val isActive: Boolean? = null
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package kr.co.vividnext.sodalive.audition
|
||||
|
||||
import kr.co.vividnext.sodalive.common.BaseEntity
|
||||
import javax.persistence.Column
|
||||
import javax.persistence.Entity
|
||||
import javax.persistence.EnumType
|
||||
import javax.persistence.Enumerated
|
||||
|
@ -11,6 +12,8 @@ import javax.persistence.ManyToOne
|
|||
@Entity
|
||||
data class AuditionRole(
|
||||
var name: String,
|
||||
@Column(columnDefinition = "TEXT")
|
||||
var information: String,
|
||||
// 오디션 대본 URL
|
||||
var auditionScriptUrl: String? = null,
|
||||
@Enumerated(value = EnumType.STRING)
|
||||
|
|
Loading…
Reference in New Issue