From 8895d30b228dd9257e38e89ddba96a5abc7cff6d Mon Sep 17 00:00:00 2001 From: Hedi Date: Tue, 14 Dec 2021 16:11:23 +0100 Subject: [PATCH] Ajout class+controller --- .../controller/MembreController.java | 62 +++++++++++++++++-- src/main/java/fr/organizee/model/Membre.java | 24 ++++--- src/main/java/fr/organizee/model/Menu.java | 5 +- src/main/java/fr/organizee/model/Smiley.java | 46 -------------- src/main/java/fr/organizee/model/Team.java | 6 +- .../repository/MembreRepository.java | 1 + .../organizee/repository/TeamRepository.java | 7 ++- .../repository/TodoListRepository.java | 7 ++- 8 files changed, 95 insertions(+), 63 deletions(-) delete mode 100644 src/main/java/fr/organizee/model/Smiley.java diff --git a/src/main/java/fr/organizee/controller/MembreController.java b/src/main/java/fr/organizee/controller/MembreController.java index d62951a..d96e0a9 100644 --- a/src/main/java/fr/organizee/controller/MembreController.java +++ b/src/main/java/fr/organizee/controller/MembreController.java @@ -1,16 +1,17 @@ package fr.organizee.controller; import fr.organizee.model.Membre; +import fr.organizee.model.Team; import fr.organizee.repository.MembreRepository; +import fr.organizee.repository.TeamRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Optional; + /* toto */ @RestController @CrossOrigin("*") @@ -19,17 +20,20 @@ public class MembreController { @Autowired private MembreRepository membreRepo; + @Autowired + private TeamRepository teamRepo; + @GetMapping("/") @ResponseBody public String home() { StringBuilder sb = new StringBuilder(); sb.append("

Affichages des membres

"); - sb.append("