diff --git a/pom.xml b/pom.xml
index d4a56a4..8959869 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,6 +7,13 @@
org.example
bda-tortoises-races
1.0-SNAPSHOT
+
+
+ org.springframework
+ spring-web
+ 5.3.13
+
+
11
diff --git a/src/main/java/App.java b/src/main/java/App.java
deleted file mode 100644
index bc8be06..0000000
--- a/src/main/java/App.java
+++ /dev/null
@@ -1,5 +0,0 @@
-public class App {
- public static void main(String[] args) {
- System.out.println("hello workskvdjbsd");
- }
-}
diff --git a/src/main/java/fr/univlyon1/bda/App.java b/src/main/java/fr/univlyon1/bda/App.java
new file mode 100644
index 0000000..a75ad3a
--- /dev/null
+++ b/src/main/java/fr/univlyon1/bda/App.java
@@ -0,0 +1,22 @@
+package fr.univlyon1.bda;
+
+
+import fr.univlyon1.bda.extern.RaceServiceREST;
+import fr.univlyon1.bda.modele.RaceMoment;
+
+public class App {
+
+ public static void main(String[] args) {
+ System.out.println("START APPLICATION...");
+
+ RaceServiceREST raceServiceREST = new RaceServiceREST();
+
+ try {
+ RaceMoment raceMoment = raceServiceREST.getRaceMoment();
+ raceMoment.print();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+}
diff --git a/src/main/java/fr/univlyon1/bda/extern/RaceServiceREST.java b/src/main/java/fr/univlyon1/bda/extern/RaceServiceREST.java
new file mode 100755
index 0000000..9dea3ba
--- /dev/null
+++ b/src/main/java/fr/univlyon1/bda/extern/RaceServiceREST.java
@@ -0,0 +1,18 @@
+package fr.univlyon1.bda.extern;
+
+import fr.univlyon1.bda.modele.RaceMoment;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.RestTemplate;
+
+
+public class RaceServiceREST {
+
+ RestTemplate restTemplate = new RestTemplate();
+
+ public RaceMoment getRaceMoment() throws Exception {
+ ResponseEntity response
+ = restTemplate.getForEntity("http://tortues.ecoquery.os.univ-lyon1.fr/race/tiny", RaceMoment.class);
+
+ return response.getBody();
+ }
+}
diff --git a/src/main/java/fr/univlyon1/bda/modele/RaceMoment.java b/src/main/java/fr/univlyon1/bda/modele/RaceMoment.java
new file mode 100755
index 0000000..1d6afd6
--- /dev/null
+++ b/src/main/java/fr/univlyon1/bda/modele/RaceMoment.java
@@ -0,0 +1,57 @@
+package fr.univlyon1.bda.modele;
+
+
+public class RaceMoment {
+
+ private float quality;
+ private float temperature;
+ private Tortoise[] tortoises;
+
+
+ public RaceMoment(float quality, float temperature, Tortoise[] tortoises) {
+ this.quality = quality;
+ this.temperature = temperature;
+ this.tortoises = tortoises;
+ }
+
+ public void print() {
+ int i = 0;
+ String str = "";
+ while(i < tortoises.length || i < 10) {
+ str += " { \"id\": "+tortoises[i].getId()+", \"top\": "+tortoises[i].getTop()+", \"position\": "+tortoises[i].getPosition()+" },\n";
+ i++;
+ }
+ System.out.println("\n" +
+ "{\n" +
+ " tortoises : [\n" +
+ str +
+ " ]," +
+ " qualite : " + quality + "\n" +
+ " temperature : " + temperature + "\n" +
+ "}");
+ }
+
+ public float getQuality() {
+ return quality;
+ }
+
+ public void setQuality(float quality) {
+ this.quality = quality;
+ }
+
+ public float getTemperature() {
+ return temperature;
+ }
+
+ public void setTemperature(float temperature) {
+ this.temperature = temperature;
+ }
+
+ public Tortoise[] getTortoises() {
+ return tortoises;
+ }
+
+ public void setTortoises(Tortoise[] tortoises) {
+ this.tortoises = tortoises;
+ }
+}
diff --git a/src/main/java/fr/univlyon1/bda/modele/Tortoise.java b/src/main/java/fr/univlyon1/bda/modele/Tortoise.java
new file mode 100755
index 0000000..e0f247a
--- /dev/null
+++ b/src/main/java/fr/univlyon1/bda/modele/Tortoise.java
@@ -0,0 +1,38 @@
+package fr.univlyon1.bda.modele;
+
+public class Tortoise {
+
+ private int id;
+ private int top;
+ private int position;
+
+ public Tortoise(int id, int top, int position) {
+ this.id = id;
+ this.top = top;
+ this.position = position;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getTop() {
+ return top;
+ }
+
+ public void setTop(int top) {
+ this.top = top;
+ }
+
+ public int getPosition() {
+ return position;
+ }
+
+ public void setPosition(int position) {
+ this.position = position;
+ }
+}