diff --git a/back_end/pom.xml b/back_end/pom.xml index e8bf001..a2c98b2 100644 --- a/back_end/pom.xml +++ b/back_end/pom.xml @@ -103,6 +103,12 @@ 1.18.32 provided + + org.springdoc + springdoc-openapi-starter-webmvc-ui + 2.5.0 + + diff --git a/back_end/src/main/java/hackathon/FrisbYEE/jpa/dto/AthleteDTO.java b/back_end/src/main/java/hackathon/FrisbYEE/jpa/dto/AthleteDTO.java new file mode 100644 index 0000000..3e8421a --- /dev/null +++ b/back_end/src/main/java/hackathon/FrisbYEE/jpa/dto/AthleteDTO.java @@ -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 groupes; + +} diff --git a/back_end/src/main/java/hackathon/FrisbYEE/rest/ActiviteResources.java b/back_end/src/main/java/hackathon/FrisbYEE/rest/ActiviteResources.java new file mode 100644 index 0000000..405ed1c --- /dev/null +++ b/back_end/src/main/java/hackathon/FrisbYEE/rest/ActiviteResources.java @@ -0,0 +1,5 @@ +package hackathon.FrisbYEE.rest; + +public class ActiviteResources { + +} diff --git a/back_end/src/main/java/hackathon/FrisbYEE/rest/AthleteResource.java b/back_end/src/main/java/hackathon/FrisbYEE/rest/AthleteResource.java new file mode 100644 index 0000000..9b8b1cb --- /dev/null +++ b/back_end/src/main/java/hackathon/FrisbYEE/rest/AthleteResource.java @@ -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; + } + +} diff --git a/back_end/src/main/resources/application.properties b/back_end/src/main/resources/application.properties index 8cc7072..e8c426c 100644 --- a/back_end/src/main/resources/application.properties +++ b/back_end/src/main/resources/application.properties @@ -1 +1,11 @@ -spring.application.name=FrisbYEE +spring.datasource.url=jdbc:postgresql://localhost:5432/frisbyee +spring.datasource.username=postgres +spring.datasource.password=postgres +spring.datasource.driver-class-name=org.postgresql.Driver + +spring.jpa.hibernate.ddl-auto=update +spring.jpa.show-sql=true +spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect +spring.datasource.url=jdbc:postgresql://localhost:5432/frisbyee +spring.datasource.username=frisbyee_user +spring.datasource.password=secret \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c78c425..3f010ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,3 +27,20 @@ services: interval: 5s timeout: 5s retries: 20 + postgres: + image: postgres:16 + container_name: frisbyee-postgres + ports: + - "5432:5432" + environment: + POSTGRES_DB: frisbyee + POSTGRES_USER: frisbyee_user + POSTGRES_PASSWORD: secret + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: + +version: "3.9" +