fix IDE warnings

This commit is contained in:
2026-02-04 20:56:05 +01:00
parent a90d518fc3
commit 41fda9770a
10 changed files with 6 additions and 25 deletions

View File

@@ -17,7 +17,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.UUID;
@RestController @RestController
@RequestMapping("/racers") @RequestMapping("/racers")

View File

@@ -29,7 +29,7 @@ public class TeamRestController {
/** /**
* Creates a team with the information provided via the /teams/createTeam endpoint * Creates a team with the information provided via the /teams/createTeam endpoint
* @param team * @param team Team object with the information to be used on creation
* @return a ResponseEntity, * @return a ResponseEntity,
* either containing a TeamWSTO if a team was successfully created or a HttpStatus.CONFLICT if the team already existed beforehand * either containing a TeamWSTO if a team was successfully created or a HttpStatus.CONFLICT if the team already existed beforehand
*/ */

View File

@@ -1,7 +1,6 @@
package de.pnreichmuth.timekeep_backend.exceptions; package de.pnreichmuth.timekeep_backend.exceptions;
import de.pnreichmuth.timekeep_backend.entities.Racer; import de.pnreichmuth.timekeep_backend.entities.Racer;
import de.pnreichmuth.timekeep_backend.entities.Team;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j

View File

@@ -1,8 +1,6 @@
package de.pnreichmuth.timekeep_backend.exceptions; package de.pnreichmuth.timekeep_backend.exceptions;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@Slf4j @Slf4j
public class RacerNotFoundException extends NotFoundException { public class RacerNotFoundException extends NotFoundException {

View File

@@ -2,8 +2,6 @@ package de.pnreichmuth.timekeep_backend.exceptions;
import de.pnreichmuth.timekeep_backend.entities.Team; import de.pnreichmuth.timekeep_backend.entities.Team;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@Slf4j @Slf4j
public class TeamExistsException extends ExistsException { public class TeamExistsException extends ExistsException {

View File

@@ -1,8 +1,6 @@
package de.pnreichmuth.timekeep_backend.exceptions; package de.pnreichmuth.timekeep_backend.exceptions;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@Slf4j @Slf4j
public class TeamNotFoundException extends NotFoundException { public class TeamNotFoundException extends NotFoundException {

View File

@@ -1,12 +1,10 @@
package de.pnreichmuth.timekeep_backend.repositories; package de.pnreichmuth.timekeep_backend.repositories;
import de.pnreichmuth.timekeep_backend.entities.Racer; import de.pnreichmuth.timekeep_backend.entities.Racer;
import de.pnreichmuth.timekeep_backend.entities.Team;
import lombok.NonNull; import lombok.NonNull;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;

View File

@@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID;
@Service @Service
@Slf4j @Slf4j

View File

@@ -8,7 +8,7 @@ package de.pnreichmuth.timekeep_backend.spring_configs;
// //
// //
//@Configuration //@Configuration
////@EnableWebSecurity //@EnableWebSecurity
//public class TimekeepBackendSecurityConfig { //public class TimekeepBackendSecurityConfig {
// @Bean // @Bean
// public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { // public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {

View File

@@ -20,14 +20,10 @@ public record TeamWSTO(String teamName,
public static TeamWSTO of(Team team){ public static TeamWSTO of(Team team){
List<RacerWSTO> tempMemberList = new ArrayList<>(); List<RacerWSTO> tempMemberList = new ArrayList<>();
team.getMembers().forEach(member -> { team.getMembers().forEach(member -> tempMemberList.add(RacerWSTO.of(member)));
tempMemberList.add(RacerWSTO.of(member));
});
List<StationWSTO> tempStationList = new ArrayList<>(); List<StationWSTO> tempStationList = new ArrayList<>();
team.getPassedStations().forEach(passedStation -> { team.getPassedStations().forEach(passedStation -> tempStationList.add(StationWSTO.of(passedStation)));
tempStationList.add(StationWSTO.of(passedStation));
});
return new TeamWSTO( return new TeamWSTO(
team.getTeamName(), team.getTeamName(),
@@ -39,14 +35,10 @@ public record TeamWSTO(String teamName,
public static Team toEntity(TeamWSTO teamWSTO){ public static Team toEntity(TeamWSTO teamWSTO){
List<Racer> tempMemberList = new ArrayList<>(); List<Racer> tempMemberList = new ArrayList<>();
teamWSTO.teamMembers().forEach(member -> { teamWSTO.teamMembers().forEach(member -> tempMemberList.add(RacerWSTO.toEntity(member)));
tempMemberList.add(RacerWSTO.toEntity(member));
});
List<Station> tempStationList = new ArrayList<>(); List<Station> tempStationList = new ArrayList<>();
teamWSTO.passedStations().forEach(passedStation -> { teamWSTO.passedStations().forEach(passedStation -> tempStationList.add(StationWSTO.toEntity(passedStation)));
tempStationList.add(StationWSTO.toEntity(passedStation));
});
return new Team( return new Team(
teamWSTO.teamName(), teamWSTO.teamName(),