Skip to content
Snippets Groups Projects
Commit 50e9d60f authored by Seidel Leon's avatar Seidel Leon
Browse files

08.01.2024 - added getTournament and deleteTournament methods #24

parent 99be5327
No related branches found
No related tags found
1 merge request!7Dev in Main Merge
......@@ -183,6 +183,22 @@ public class TournamentService {
log.debug("Team " + teamId + " assign to Match " + matchId + " in Tournament " + tournamentId);
}
public Tournament getTournament(UUID tournamentId) throws TournamentIdNotFoundException {
Tournament tournament = tournamentRepository.findById(tournamentId)
.orElseThrow(() -> new TournamentIdNotFoundException(tournamentId));
log.debug(tournament + "is found");
return tournament;
}
public void deleteTournament(UUID tournamentId) throws TournamentIdNotFoundException {
Tournament tournamentToDelete = tournamentRepository.findById(tournamentId)
.orElseThrow(() -> new TournamentIdNotFoundException(tournamentId));
tournamentRepository.delete(tournamentToDelete);
log.debug("Tournament " + tournamentId + " has been deleted");
}
/*
Weitere Methoden:
Gewinner bestimmen, defineWinner()
......
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