Skip to content
Snippets Groups Projects
Commit 29cdd86c authored by mhaed's avatar mhaed
Browse files

28.12.2023 - controller updated #24

parent e84e61f3
No related branches found
No related tags found
1 merge request!7Dev in Main Merge
package hdm.mi.sthbackend.controller;
import hdm.mi.sthbackend.exeptions.MatchIdNotFoundException;
import hdm.mi.sthbackend.exeptions.PlayerIdNotFoundException;
import hdm.mi.sthbackend.exeptions.TeamIdNotFoundException;
import hdm.mi.sthbackend.exeptions.TournamentIdNotFoundException;
......@@ -43,7 +44,7 @@ public class TournamentController {
public UUID removeTeamFromTournament(@PathVariable UUID tournamentId,
@PathVariable UUID teamId) throws TournamentIdNotFoundException, TeamIdNotFoundException{
return service.removeTeamFromTournament(tournamentId, teamId);
};
}
@PostMapping("/{tournamentId}/teams/{teamId}/addPlayer")
public Player addPlayerToTeam(@PathVariable UUID tournamentId,
......@@ -55,8 +56,14 @@ public class TournamentController {
@DeleteMapping("/{tournamentId}/teams/{teamId}/players/{playerId}")
public Player removePlayerFromTeam(@PathVariable UUID tournamentId,
@PathVariable UUID teamId,
@PathVariable UUID playerId) throws PlayerIdNotFoundException, TournamentIdNotFoundException {
return service.removePlayerFromTeam(tournamentId, teamId, playerId);
@PathVariable UUID playerId) throws PlayerIdNotFoundException, TournamentIdNotFoundException { // muss hier die PlayerIdNotFoundException eingefügt werden,
return service.removePlayerFromTeam(tournamentId, teamId, playerId); // wenn die nicht im TournamentService drin ist?
}
@PatchMapping
public UUID determineWinner(@PathVariable UUID tournamentId,
@PathVariable UUID matchId) throws TournamentIdNotFoundException, MatchIdNotFoundException {
return service.determineWinner(tournamentId, matchId);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment