룰렛 프리셋 API 추가
- 룰렛 만들기 - 룰렛 업데이트 - 룰렛 프리셋 전체 가져오기
This commit is contained in:
		| @@ -36,11 +36,11 @@ class NewRouletteService( | |||||||
|     fun getAllRoulette(creatorId: Long, memberId: Long): List<GetNewRouletteResponse> { |     fun getAllRoulette(creatorId: Long, memberId: Long): List<GetNewRouletteResponse> { | ||||||
|         if (creatorId != memberId) throw SodaException("잘못된 요청입니다.") |         if (creatorId != memberId) throw SodaException("잘못된 요청입니다.") | ||||||
|  |  | ||||||
|         val rouletteList = repository.findByCreatorId(creatorId) |         var rouletteList = repository.findByCreatorId(creatorId) | ||||||
|         if (rouletteList.isEmpty()) { |         if (rouletteList.isEmpty()) { | ||||||
|             val roulette = oldRepository.findByIdOrNull(creatorId) |             val roulette = oldRepository.findByIdOrNull(creatorId) | ||||||
|             if (roulette != null) { |             if (roulette != null) { | ||||||
|                 val newRoulette = repository.save( |                 repository.save( | ||||||
|                     NewRoulette( |                     NewRoulette( | ||||||
|                         id = idGenerator.generateId(SEQUENCE_NAME), |                         id = idGenerator.generateId(SEQUENCE_NAME), | ||||||
|                         creatorId = creatorId, |                         creatorId = creatorId, | ||||||
| @@ -50,7 +50,7 @@ class NewRouletteService( | |||||||
|                     ) |                     ) | ||||||
|                 ) |                 ) | ||||||
|  |  | ||||||
|                 rouletteList.toMutableList().add(newRoulette) |                 rouletteList = repository.findByCreatorId(creatorId) | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user