From 20382c2d1be1b7bc7aed441063893050168d8ac9 Mon Sep 17 00:00:00 2001 From: Sana EL HIRI Date: Wed, 2 Mar 2022 19:18:33 +0100 Subject: [PATCH] modif team et membre controller --- .../controller/MembreController.java | 114 +++++++++--------- .../organizee/controller/TeamController.java | 80 +++++++----- 2 files changed, 103 insertions(+), 91 deletions(-) diff --git a/src/main/java/fr/organizee/controller/MembreController.java b/src/main/java/fr/organizee/controller/MembreController.java index a498165..c8b8c93 100644 --- a/src/main/java/fr/organizee/controller/MembreController.java +++ b/src/main/java/fr/organizee/controller/MembreController.java @@ -6,11 +6,9 @@ import fr.organizee.exception.ExistingUsernameException; import fr.organizee.exception.InvalidCredentialsException; import fr.organizee.exception.MembreNotFoundException; import fr.organizee.model.Membre; -import fr.organizee.model.Menu; import fr.organizee.model.Team; import fr.organizee.repository.MembreRepository; import fr.organizee.service.MembreService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; @@ -24,42 +22,39 @@ import java.util.UUID; import java.util.stream.Collectors; +@CrossOrigin(origins = "*") +@RequestMapping(value = "/membres") @RestController -@CrossOrigin("*") -@RequestMapping(value="/membres") public class MembreController { - @Autowired - private MembreRepository membreRepo; - - @Autowired + private MembreRepository membreRepository; private MembreService membreService; - @Autowired private BCryptPasswordEncoder passwordEncoder; - public MembreController() {} - - @ResponseBody - public String home() - { - StringBuilder sb = new StringBuilder(); - sb.append("

Affichages des membres

"); - sb.append("