mirror of
https://github.com/PaulReichmuth/timekeep-backend.git
synced 2026-02-05 20:43:27 +00:00
fix IDE warnings
This commit is contained in:
@@ -17,7 +17,6 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/racers")
|
||||
|
||||
@@ -29,7 +29,7 @@ public class TeamRestController {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
* either containing a TeamWSTO if a team was successfully created or a HttpStatus.CONFLICT if the team already existed beforehand
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package de.pnreichmuth.timekeep_backend.exceptions;
|
||||
|
||||
import de.pnreichmuth.timekeep_backend.entities.Racer;
|
||||
import de.pnreichmuth.timekeep_backend.entities.Team;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package de.pnreichmuth.timekeep_backend.exceptions;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Slf4j
|
||||
public class RacerNotFoundException extends NotFoundException {
|
||||
|
||||
@@ -2,8 +2,6 @@ package de.pnreichmuth.timekeep_backend.exceptions;
|
||||
|
||||
import de.pnreichmuth.timekeep_backend.entities.Team;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Slf4j
|
||||
public class TeamExistsException extends ExistsException {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package de.pnreichmuth.timekeep_backend.exceptions;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Slf4j
|
||||
public class TeamNotFoundException extends NotFoundException {
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package de.pnreichmuth.timekeep_backend.repositories;
|
||||
|
||||
import de.pnreichmuth.timekeep_backend.entities.Racer;
|
||||
import de.pnreichmuth.timekeep_backend.entities.Team;
|
||||
import lombok.NonNull;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
|
||||
@@ -8,7 +8,7 @@ package de.pnreichmuth.timekeep_backend.spring_configs;
|
||||
//
|
||||
//
|
||||
//@Configuration
|
||||
////@EnableWebSecurity
|
||||
//@EnableWebSecurity
|
||||
//public class TimekeepBackendSecurityConfig {
|
||||
// @Bean
|
||||
// public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
|
||||
@@ -20,14 +20,10 @@ public record TeamWSTO(String teamName,
|
||||
|
||||
public static TeamWSTO of(Team team){
|
||||
List<RacerWSTO> tempMemberList = new ArrayList<>();
|
||||
team.getMembers().forEach(member -> {
|
||||
tempMemberList.add(RacerWSTO.of(member));
|
||||
});
|
||||
team.getMembers().forEach(member -> tempMemberList.add(RacerWSTO.of(member)));
|
||||
|
||||
List<StationWSTO> tempStationList = new ArrayList<>();
|
||||
team.getPassedStations().forEach(passedStation -> {
|
||||
tempStationList.add(StationWSTO.of(passedStation));
|
||||
});
|
||||
team.getPassedStations().forEach(passedStation -> tempStationList.add(StationWSTO.of(passedStation)));
|
||||
|
||||
return new TeamWSTO(
|
||||
team.getTeamName(),
|
||||
@@ -39,14 +35,10 @@ public record TeamWSTO(String teamName,
|
||||
|
||||
public static Team toEntity(TeamWSTO teamWSTO){
|
||||
List<Racer> tempMemberList = new ArrayList<>();
|
||||
teamWSTO.teamMembers().forEach(member -> {
|
||||
tempMemberList.add(RacerWSTO.toEntity(member));
|
||||
});
|
||||
teamWSTO.teamMembers().forEach(member -> tempMemberList.add(RacerWSTO.toEntity(member)));
|
||||
|
||||
List<Station> tempStationList = new ArrayList<>();
|
||||
teamWSTO.passedStations().forEach(passedStation -> {
|
||||
tempStationList.add(StationWSTO.toEntity(passedStation));
|
||||
});
|
||||
teamWSTO.passedStations().forEach(passedStation -> tempStationList.add(StationWSTO.toEntity(passedStation)));
|
||||
|
||||
return new Team(
|
||||
teamWSTO.teamName(),
|
||||
|
||||
Reference in New Issue
Block a user