룰렛 옵션 저장
- percentage(퍼센트) -> weight(가중치)로 변경
This commit is contained in:
		| @@ -14,5 +14,5 @@ data class Roulette( | ||||
|  | ||||
| data class RouletteItem( | ||||
|     val title: String, | ||||
|     val percentage: Int | ||||
|     val weight: Int | ||||
| ) | ||||
|   | ||||
| @@ -43,14 +43,6 @@ class RouletteService( | ||||
|         if (request.items.size < 2 || request.items.size > 6) { | ||||
|             throw SodaException("룰렛 옵션은 최소 2개, 최대 6개까지 설정할 수 있습니다.") | ||||
|         } | ||||
|  | ||||
|         val percentage = request.items.asSequence() | ||||
|             .map { it.percentage } | ||||
|             .reduce { acc, percentage -> acc + percentage } | ||||
|  | ||||
|         if (percentage != 100) { | ||||
|             throw SodaException("옵션 확률의 합이 100%가 아닙니다.") | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     fun getRoulette(creatorId: Long): GetRouletteResponse? { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user