크리에이터 관리자 시그니처 설정

- 재생 시간, 캔 유효성 검사 추가
This commit is contained in:
Klaus 2024-05-01 19:13:27 +09:00
parent 1a89177ecc
commit f4d9fa69e4
1 changed files with 6 additions and 4 deletions

View File

@ -41,8 +41,8 @@ class CreatorAdminSignatureService(
val member = memberRepository.findCreatorByIdOrNull(memberId = memberId)
?: throw SodaException("잘못된 접근입니다.")
if (can <= 0) throw SodaException("1캔 이상 입력하세요")
if (time < 3 || time > 20) throw SodaException("입력가능한 시간은 3~20초 입니다.")
if (can <= 0) throw SodaException("1캔 이상 설정할 수 있습니다.")
if (time < 3 || time > 20) throw SodaException("시간은 3초 이상 20초 이하로 설정할 수 있습니다.")
val signatureCan = SignatureCan(can = can, time = time, isAdult = isAdult)
signatureCan.creator = member
@ -73,11 +73,13 @@ class CreatorAdminSignatureService(
val signatureCan = repository.findSignatureByIdOrNull(id = id, memberId = memberId)
?: throw SodaException("잘못된 요청입니다.")
if (can != null && can > 0) {
if (can != null) {
if (can <= 0) throw SodaException("1캔 이상 설정할 수 있습니다.")
signatureCan.can = can
}
if (time != null && time >= 3 && time <= 20) {
if (time != null) {
if (time < 3 || time > 20) throw SodaException("시간은 3초 이상 20초 이하로 설정할 수 있습니다.")
signatureCan.time = time
}