test #96

Merged
klaus merged 12 commits from test into main 2023-12-07 01:46:33 +00:00
3 changed files with 6 additions and 3 deletions
Showing only changes of commit 0e8d3656b2 - Show all commits

View File

@ -2,5 +2,6 @@ package kr.co.vividnext.sodalive.live.roulette
data class GetRouletteResponse(
val can: Int,
val isActive: Boolean,
val items: List<RouletteItem>
)

View File

@ -35,7 +35,9 @@ class RouletteController(private val service: RouletteService) {
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
val response = service.getRoulette(creatorId = creatorId)
?: throw SodaException("룰렛을 사용할 수 없습니다.")
if (response == null && creatorId != member.id!!) {
throw SodaException("룰렛을 사용할 수 없습니다.")
}
return ApiResponse.ok(response)
}

View File

@ -60,7 +60,7 @@ class RouletteService(
return null
}
return GetRouletteResponse(can = roulette.can, items = roulette.items)
return GetRouletteResponse(can = roulette.can, isActive = roulette.isActive, items = roulette.items)
}
@Transactional
@ -91,7 +91,7 @@ class RouletteService(
container = request.container
)
return GetRouletteResponse(can = roulette.can, items = roulette.items)
return GetRouletteResponse(can = roulette.can, isActive = roulette.isActive, items = roulette.items)
}
private fun getOrCreateLock(memberId: Long): ReentrantReadWriteLock {