First DTO
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package hackathon.FrisbYEE.jpa.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AthleteDTO implements java.io.Serializable {
|
||||
|
||||
private String nom;
|
||||
private String niveau;
|
||||
private String categorie;
|
||||
private List<String> groupes;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package hackathon.FrisbYEE.rest;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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.service.AthleteDAO;
|
||||
|
||||
public class AthleteResource {
|
||||
|
||||
private AthleteDAO athleteDAO;
|
||||
|
||||
@Operation(summary = "Récupère tous les utilisateurs")
|
||||
@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)))
|
||||
})
|
||||
@GetMapping("/joueur/{id}")
|
||||
public JoueurDTO getJoueurById(@PathVariable Integer joueurId) {
|
||||
// return pet
|
||||
System.out.println("ID A CHERCHER" + joueurId);
|
||||
IJoueur j = dao.findOne(joueurId);
|
||||
JoueurDTO jDTO = new JoueurDTO(null, null);
|
||||
System.out.println(j);
|
||||
return jDTO;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user