Adds/collects Hunter endpoints and cleans up the code a bit
This commit is contained in:
@@ -15,7 +15,7 @@ import java.time.LocalDateTime
|
||||
@Service
|
||||
class HuntService(private val huntRepository: HuntRepository) {
|
||||
fun getHunt(huntId: HuntId): Hunt {
|
||||
return huntRepository.findByIdOrNull(huntId)?.toDomain() ?: throw NotFoundException("No hunt with id ${huntId} found")
|
||||
return huntRepository.findByIdOrNull(huntId)?.toDomain() ?: throw NotFoundException("No hunt with id $huntId found")
|
||||
}
|
||||
|
||||
fun getAllHunts(status: HuntStatus?): List<Hunt> {
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.security.core.userdetails.UserDetails
|
||||
import org.springframework.security.core.userdetails.UserDetailsService
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException
|
||||
import org.springframework.stereotype.Service
|
||||
import java.util.Collections
|
||||
import java.util.*
|
||||
|
||||
|
||||
@Service
|
||||
|
||||
@@ -8,16 +8,13 @@ import net.halfbinary.scavengerhuntapi.model.converter.toRecord
|
||||
import net.halfbinary.scavengerhuntapi.model.domain.Team
|
||||
import net.halfbinary.scavengerhuntapi.model.domain.TeamHunt
|
||||
import net.halfbinary.scavengerhuntapi.model.record.HunterTeamRecord
|
||||
import net.halfbinary.scavengerhuntapi.model.record.TeamHuntRecord
|
||||
import net.halfbinary.scavengerhuntapi.model.record.TeamRecord
|
||||
import net.halfbinary.scavengerhuntapi.model.request.TeamRequest
|
||||
import net.halfbinary.scavengerhuntapi.model.response.TeamResponse
|
||||
import net.halfbinary.scavengerhuntapi.repository.HunterRepository
|
||||
import net.halfbinary.scavengerhuntapi.repository.HunterTeamRepository
|
||||
import net.halfbinary.scavengerhuntapi.repository.TeamHuntRepository
|
||||
import net.halfbinary.scavengerhuntapi.repository.TeamRepository
|
||||
import org.springframework.stereotype.Service
|
||||
import java.util.UUID
|
||||
import java.util.*
|
||||
|
||||
@Service
|
||||
class TeamService(
|
||||
|
||||
Reference in New Issue
Block a user