룰렛 만들기
- 만드는 룰렛이 활성화하면 나머지 룰렛을 비활성화 하도록 수정
This commit is contained in:
@@ -71,6 +71,14 @@ class NewRouletteService(
|
||||
fun createRoulette(memberId: Long, request: CreateNewRouletteRequest): Boolean {
|
||||
rouletteValidate(can = request.can, items = request.items)
|
||||
|
||||
if (request.isActive) {
|
||||
val rouletteList = repository.findByCreatorId(creatorId = memberId)
|
||||
rouletteList.forEach {
|
||||
it.isActive = false
|
||||
repository.save(it)
|
||||
}
|
||||
}
|
||||
|
||||
val roulette = NewRoulette(
|
||||
id = idGenerator.generateId(SEQUENCE_NAME),
|
||||
creatorId = memberId,
|
||||
|
Reference in New Issue
Block a user