Fixed compilation errors in AthleteResource
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package hackathon.FrisbYEE.jpa.interfaces;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface IAthlete{
|
||||
public void run();
|
||||
|
||||
|
||||
}
|
||||
@@ -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> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user