Adds user level hunt endpoints

This commit is contained in:
2026-05-12 10:08:34 -05:00
parent ab34f16a45
commit 46a78bfc08
4 changed files with 83 additions and 3 deletions

View File

@@ -0,0 +1,15 @@
package net.halfbinary.scavengerhuntapi.service
import net.halfbinary.scavengerhuntapi.error.exception.NotFoundException
import net.halfbinary.scavengerhuntapi.model.converter.toDomain
import net.halfbinary.scavengerhuntapi.model.domain.Hunter
import net.halfbinary.scavengerhuntapi.repository.HunterRepository
import org.springframework.stereotype.Service
@Service
class HunterService(private val hunterRepository: HunterRepository) {
fun getHunterByEmail(email: String): Hunter {
return hunterRepository.findByEmail(email)?.toDomain()
?: throw NotFoundException("No hunter with email $email found")
}
}