Skip to content
Snippets Groups Projects
Commit b4b1f27e authored by Schneider Stefan's avatar Schneider Stefan
Browse files

Merge remote-tracking branch 'origin/dev' into dev

parents c6e73bd2 9f143387
No related branches found
No related tags found
1 merge request!7Dev in Main Merge
...@@ -2,6 +2,7 @@ package hdm.mi.sthbackend.model; ...@@ -2,6 +2,7 @@ package hdm.mi.sthbackend.model;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
...@@ -14,7 +15,7 @@ import java.util.UUID; ...@@ -14,7 +15,7 @@ import java.util.UUID;
public class Team { public class Team {
@Id @Id
private final UUID id; private final UUID id;
@Setter
private final String teamName; private String teamName;
private final List<UUID> teamMembers; private final List<UUID> teamMembers;
} }
...@@ -195,7 +195,17 @@ public class TournamentService { ...@@ -195,7 +195,17 @@ public class TournamentService {
} }
match.getTeamScores().put(teamId, newScore); match.getTeamScores().put(teamId, newScore);
tournamentRepository.save(tournament); tournamentRepository.save(tournament);
log.debug("Score von Team " + teamId + " auf " + newScore + " geupdatet"); log.debug("Score of Team " + teamId + " updated to " + newScore);
}
public UUID updateTeamName(UUID teamId, String newTeamName) throws TeamIdNotFoundException {
Team team = teamRepository.findById(teamId)
.orElseThrow(() -> new TeamIdNotFoundException(teamId));
team.setTeamName(newTeamName);
teamRepository.save(team);
log.debug("Teamname of " + teamId + " updated to " + newTeamName);
return teamId;
} }
public UUID updateTournamentName(UUID tournamentId, String newTournamentName)throws TournamentIdNotFoundException{ public UUID updateTournamentName(UUID tournamentId, String newTournamentName)throws TournamentIdNotFoundException{
......
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