Implements remove photo endpoint

This commit is contained in:
2026-05-14 23:55:05 -05:00
parent dbd988a573
commit ac6f3a7014
5 changed files with 40 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ import net.halfbinary.scavengerhuntapi.service.TeamService
import org.springframework.http.ResponseEntity
import org.springframework.security.core.Authentication
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PatchMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
@@ -64,6 +65,16 @@ class TeamController(private val teamService: TeamService, private val photoServ
TODO("Get list of photo information for the specified Team, Hunt, and Item")
}
@PatchMapping("/{teamId}/item/{itemId}/photo/{photoId}")
@Operation(summary = "Mark the specified Photo as removed")
fun removePhoto(@PathVariable huntId: HuntId,
@PathVariable teamId: TeamId,
@PathVariable itemId: ItemId,
@PathVariable photoId: PhotoId,
authentication: Authentication) {
photoService.removePhoto(huntId, teamId, itemId, photoId, authentication.name)
}
@GetMapping("/{teamId}/item/{itemId}/photo/{photoId}")
@Operation(summary = "Get photo information for the specified Team, Hunt, Item, and Photo")
fun getPhotoInfo(@PathVariable huntId: HuntId,