Fixed compilation errors in AthleteResource

This commit is contained in:
Alexis Leboeuf
2026-01-06 00:03:27 +01:00
parent fad05e8bb1
commit 5c191bcff0
3 changed files with 19 additions and 6 deletions

View File

@@ -0,0 +1,9 @@
package hackathon.FrisbYEE.jpa.interfaces;
import java.io.Serializable;
public interface IAthlete{
public void run();
}

View File

@@ -1,9 +1,11 @@
package hackathon.FrisbYEE.jpa.service;
import hackathon.FrisbYEE.jpa.metier.Athlete;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface AthleteDAO extends JpaRepository<Athlete, Integer> {
}

View File

@@ -1,5 +1,6 @@
package hackathon.FrisbYEE.rest;
import org.apache.el.stream.Optional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import io.swagger.v3.oas.annotations.Operation;
@@ -7,7 +8,8 @@ import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import hackathon.FrisbYEE.jpa.dto.AthleteDTO;
import hackathon.FrisbYEE.jpa.metier.Athlete;
import hackathon.FrisbYEE.jpa.service.AthleteDAO;
public class AthleteResource {
@@ -18,16 +20,16 @@ public class AthleteResource {
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Récupère le Joueur ayant l'identifiant correspondant",
content = @Content(mediaType = "application/json",
schema = @Schema(implementation = JoueurDTO.class)))
schema = @Schema(implementation = AthleteDTO.class)))
})
@GetMapping("/joueur/{id}")
public JoueurDTO getJoueurById(@PathVariable Integer joueurId) {
public AthleteDTO getJoueurById(@PathVariable Integer joueurId) {
// return pet
System.out.println("ID A CHERCHER" + joueurId);
IJoueur j = dao.findOne(joueurId);
JoueurDTO jDTO = new JoueurDTO(null, null);
java.util.Optional<Athlete> j = athleteDAO.findById(joueurId);
AthleteDTO jDTO = new AthleteDTO();
System.out.println(j);
return jDTO;
}
}