시그니처 후원
- 재생 시간, 캔 유효성 검사 추가
This commit is contained in:
@@ -41,6 +41,9 @@ 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초 입니다.")
|
||||
|
||||
val signatureCan = SignatureCan(can = can, time = time, isAdult = isAdult)
|
||||
signatureCan.creator = member
|
||||
repository.save(signatureCan)
|
||||
@@ -70,11 +73,11 @@ class CreatorAdminSignatureService(
|
||||
val signatureCan = repository.findSignatureByIdOrNull(id = id, memberId = memberId)
|
||||
?: throw SodaException("잘못된 요청입니다.")
|
||||
|
||||
if (can != null) {
|
||||
if (can != null && can > 0) {
|
||||
signatureCan.can = can
|
||||
}
|
||||
|
||||
if (time != null) {
|
||||
if (time != null && time >= 3 && time <= 20) {
|
||||
signatureCan.time = time
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user