Reinitialisation du répo et ajout du µService de découverte
This commit is contained in:
parent
a56c2d7518
commit
4323efb293
13 changed files with 13 additions and 111 deletions
|
@ -8,23 +8,19 @@
|
||||||
<version>2.6.1</version>
|
<version>2.6.1</version>
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>fr.insa.mas</groupId>
|
<groupId>fr.insa.arm</groupId>
|
||||||
<artifactId>StudentInfoService</artifactId>
|
<artifactId>DiscoveryService</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<name>StudentInfoService</name>
|
<name>DiscoveryService</name>
|
||||||
<description>Example of collab</description>
|
<description>Discovery service of the INSA's rooms management application</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>11</java.version>
|
<java.version>11</java.version>
|
||||||
<spring-cloud.version>2021.0.0</spring-cloud.version>
|
<spring-cloud.version>2021.0.0</spring-cloud.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
|
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -33,8 +29,6 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<!-- Nouvel ajout -->
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
|
@ -1,13 +1,13 @@
|
||||||
package fr.insa.mas.StudentInfoService;
|
package fr.insa.arm.DiscoveryService;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class StudentInfoServiceApplication {
|
public class DiscoveryServiceApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(StudentInfoServiceApplication.class, args);
|
SpringApplication.run(DiscoveryServiceApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package fr.insa.mas.StudentInfoService;
|
package fr.insa.arm.DiscoveryService;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
class StudentInfoServiceApplicationTests {
|
class DiscoveryServiceApplicationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void contextLoads() {
|
void contextLoads() {
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,2 +0,0 @@
|
||||||
server.port 8083
|
|
||||||
spring.application.name=studentInfoService
|
|
Loading…
Reference in a new issue