Skip to content
Snippets Groups Projects
Commit ed9e8420 authored by Häderle Marius's avatar Häderle Marius
Browse files
parents 92877877 e5796e73
No related branches found
No related tags found
1 merge request!7Dev in Main Merge
......@@ -2,6 +2,7 @@ package hdm.mi.sthbackend.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
......@@ -15,7 +16,7 @@ import java.util.UUID;
public class Tournament implements ITournament{
@Id
private UUID tournamentId;
@Setter
private String tournamentName;
private List<Match> matches;
......
......@@ -208,6 +208,15 @@ public class TournamentService {
return teamId;
}
public UUID updateTournamentName(UUID tournamentId, String newTournamentName)throws TournamentIdNotFoundException{
Tournament tournament = tournamentRepository.findById(tournamentId)
.orElseThrow(() -> new TournamentIdNotFoundException(tournamentId));
tournament.setTournamentName(newTournamentName);
tournamentRepository.save(tournament);
log.debug("Tournament Name for TournamentID " + tournamentId + " updated to " + newTournamentName);
return tournamentId;
}
public Tournament getTournament(UUID tournamentId) throws TournamentIdNotFoundException {
Tournament tournament = tournamentRepository.findById(tournamentId)
.orElseThrow(() -> new TournamentIdNotFoundException(tournamentId));
......@@ -228,6 +237,8 @@ public class TournamentService {
Weitere Methoden:
UpdateTeamScore Marius
Tunier beenden
GetTournament Leon
DeleteTournament Leon
User Mattis
*/
......
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