From 75dbe1c4b8c0a60169b521ade2c04e67447e73be Mon Sep 17 00:00:00 2001 From: Hedi Date: Tue, 14 Dec 2021 10:04:50 +0100 Subject: [PATCH] controller --- .../controller/MembreController.java | 44 ++++++++++++ src/main/resources/data.sql | 70 +++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 src/main/java/fr/organizee/controller/MembreController.java create mode 100644 src/main/resources/data.sql diff --git a/src/main/java/fr/organizee/controller/MembreController.java b/src/main/java/fr/organizee/controller/MembreController.java new file mode 100644 index 0000000..d62951a --- /dev/null +++ b/src/main/java/fr/organizee/controller/MembreController.java @@ -0,0 +1,44 @@ +package fr.organizee.controller; + +import fr.organizee.model.Membre; +import fr.organizee.repository.MembreRepository; +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 java.util.List; +/* toto */ +@RestController +@CrossOrigin("*") +public class MembreController { + + @Autowired + private MembreRepository membreRepo; + + @GetMapping("/") + @ResponseBody + public String home() + { + StringBuilder sb = new StringBuilder(); + sb.append("

Affichages des membres

"); + sb.append("