Reinitialisation du répo et ajout du µService de découverte

This commit is contained in:
Faure Paul 2021-12-10 08:51:07 +01:00
parent a56c2d7518
commit 4323efb293
13 changed files with 13 additions and 111 deletions

View file

@ -8,23 +8,19 @@
<version>2.6.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>fr.insa.mas</groupId>
<artifactId>StudentInfoService</artifactId>
<groupId>fr.insa.arm</groupId>
<artifactId>DiscoveryService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>StudentInfoService</name>
<description>Example of collab</description>
<name>DiscoveryService</name>
<description>Discovery service of the INSA&apos;s rooms management application</description>
<properties>
<java.version>11</java.version>
<spring-cloud.version>2021.0.0</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
@ -33,8 +29,6 @@
<scope>test</scope>
</dependency>
</dependencies>
<!-- Nouvel ajout -->
<dependencyManagement>
<dependencies>
<dependency>

View file

@ -1,13 +1,13 @@
package fr.insa.mas.StudentInfoService;
package fr.insa.arm.DiscoveryService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class StudentInfoServiceApplication {
public class DiscoveryServiceApplication {
public static void main(String[] args) {
SpringApplication.run(StudentInfoServiceApplication.class, args);
SpringApplication.run(DiscoveryServiceApplication.class, args);
}
}

View file

@ -0,0 +1 @@

View file

@ -1,10 +1,10 @@
package fr.insa.mas.StudentInfoService;
package fr.insa.arm.DiscoveryService;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class StudentInfoServiceApplicationTests {
class DiscoveryServiceApplicationTests {
@Test
void contextLoads() {

View file

@ -1,64 +0,0 @@
package fr.insa.mas.StudentInfoService.model;
public class StudentInfo {
private static int compteur = 0;
private int id;
private String birthDate;
private String nom;
private String prenom;
public StudentInfo(String birthDate, String nom, String prenom) {
this.id = compteur;
compteur = compteur + 1;
this.birthDate = birthDate;
this.nom = nom;
this.prenom = prenom;
}
public StudentInfo() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getBirthDate() {
return birthDate;
}
public void setBirthDate(String birthDate) {
this.birthDate = birthDate;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
}

View file

@ -1,27 +0,0 @@
package fr.insa.mas.StudentInfoService.resource;
import java.util.List;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import fr.insa.mas.StudentInfoService.model.StudentInfo;
@RestController
@RequestMapping("/student")
public class StudentInfoResource {
private List<StudentInfo> etudiants = Arrays.asList(
new StudentInfo("28-04-1999", "Faure", "Paul"),
new StudentInfo("16-05-2000", "Giusti", "Laura"),
new StudentInfo("23-03-2000", "Duluc", "Célia"),
new StudentInfo("26-10-1999", "Garcia", "Helena")
);
@GetMapping("{idStudent}")
public StudentInfo getStudent(@PathVariable("idStudent") int id) {
System.out.println("C'est moi");
return etudiants.get(id);
}
}

View file

@ -1,2 +0,0 @@
server.port 8083
spring.application.name=studentInfoService