Adds/collects Hunter endpoints and cleans up the code a bit

This commit is contained in:
2026-05-12 23:54:27 -05:00
parent 4a1077833e
commit b2ba9ce676
17 changed files with 115 additions and 60 deletions

View File

@@ -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> {

View File

@@ -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

View File

@@ -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(