diff --git a/.gitignore b/.gitignore
index 549e00a..2ea2eec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,5 @@ build/
### VS Code ###
.vscode/
+/.idea/
+/src/main/resources/
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 6f8f4ad..a8c4885 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -6,7 +6,6 @@
-
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 53931a6..06e8b35 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,8 +1,5 @@
-<<<<<<< HEAD
-
-=======
->>>>>>> 6aab769d68a38febc5aab3691296993cf7462d11
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index c487121..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index b24858b..94a25f7 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,10 +1,6 @@
-<<<<<<< HEAD
-
-=======
->>>>>>> 6aab769d68a38febc5aab3691296993cf7462d11
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index f417ba8..32eb628 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,4 +51,4 @@
-
+
\ No newline at end of file
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..d96e0a9
--- /dev/null
+++ b/src/main/java/fr/organizee/controller/MembreController.java
@@ -0,0 +1,94 @@
+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.*;
+
+import java.util.List;
+import java.util.Optional;
+
+/* toto */
+@RestController
+@CrossOrigin("*")
+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("- Liste des membres
");
+ return sb.toString();
+ }
+
+ @GetMapping(value = "/membres/all")
+ public ResponseEntity> getAll(){
+ List liste = null;
+ try
+ {
+ liste = membreRepo.findAll();
+ } catch (Exception e) {
+ return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
+ }
+
+ return ResponseEntity.status(HttpStatus.OK).body(liste);
+ }
+
+ @GetMapping(value = "/team/all")
+ public ResponseEntity> getAllTeam(){
+ List liste = null;
+ try
+ {
+ liste = teamRepo.findAll();
+ } catch (Exception e) {
+ return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
+ }
+
+ return ResponseEntity.status(HttpStatus.OK).body(liste);
+ }
+
+ @GetMapping(value = "/membres/{id}")
+ public ResponseEntity> findById(@PathVariable int id){
+ Optional membre = null;
+ try
+ {
+ membre = membreRepo.findById(id);
+ } catch (Exception e) {
+ return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
+ }
+
+ return ResponseEntity.status(HttpStatus.OK).body(membre);
+ }
+
+ @GetMapping(value = "/membres/delete/{id}")
+ public void deleteMembreId(@PathVariable("id") Integer id) {
+
+ membreRepo.deleteById(id);
+
+ }
+
+ @GetMapping(value = "/team/{id}")
+ public ResponseEntity> findTeamById(@PathVariable int id){
+ Optional liste = null;
+ try
+ {
+ liste = teamRepo.findById(id);
+ } catch (Exception e) {
+ return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
+ }
+
+ return ResponseEntity.status(HttpStatus.OK).body(liste);
+ }
+}
diff --git a/src/main/java/fr/organizee/model/Contact.java b/src/main/java/fr/organizee/model/Contact.java
new file mode 100644
index 0000000..38a8111
--- /dev/null
+++ b/src/main/java/fr/organizee/model/Contact.java
@@ -0,0 +1,101 @@
+package fr.organizee.model;
+
+import javax.persistence.*;
+import java.time.LocalDate;
+
+@Entity
+public class Contact {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private int id;
+ private String nom;
+ private String prenom;
+ private String telephone;
+ private String email;
+ private String adresse;
+ private LocalDate dateNaissance;
+/* @ManyToOne(fetch= FetchType.EAGER)
+ @JoinColumn(name="TEAM_ID")
+ private Team team;*/
+
+ public Contact() {
+ }
+
+ public Contact(String nom, String prenom, String telephone, String email, String adresse, LocalDate dateNaissance) {
+ this.nom = nom;
+ this.prenom = prenom;
+ this.telephone = telephone;
+ this.email = email;
+ this.adresse = adresse;
+ this.dateNaissance = dateNaissance;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ 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;
+ }
+
+ public String getTelephone() {
+ return telephone;
+ }
+
+ public void setTelephone(String telephone) {
+ this.telephone = telephone;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getAdresse() {
+ return adresse;
+ }
+
+ public void setAdresse(String adresse) {
+ this.adresse = adresse;
+ }
+
+ public LocalDate getDateNaissance() {
+ return dateNaissance;
+ }
+
+ public void setDateNaissance(LocalDate dateNaissance) {
+ this.dateNaissance = dateNaissance;
+ }
+
+ @Override
+ public String toString() {
+ return "Contact{" +
+ "id=" + id +
+ ", nom='" + nom + '\'' +
+ ", prenom='" + prenom + '\'' +
+ ", telephone='" + telephone + '\'' +
+ ", email='" + email + '\'' +
+ ", adresse='" + adresse + '\'' +
+ ", dateNaissance=" + dateNaissance +
+ '}';
+ }
+}
diff --git a/src/main/java/fr/organizee/model/Membre.java b/src/main/java/fr/organizee/model/Membre.java
index a3a0d96..7924e70 100644
--- a/src/main/java/fr/organizee/model/Membre.java
+++ b/src/main/java/fr/organizee/model/Membre.java
@@ -3,6 +3,7 @@ package fr.organizee.model;
import javax.persistence.*;
import java.time.LocalDate;
+
@Entity
public class Membre {
@Id
@@ -14,8 +15,107 @@ public class Membre {
private String email;
private String password;
private String isAdmin;
- private String testGit;
- @ManyToOne(fetch= FetchType.EAGER)
+ private String couleur;
+ private String smiley;
+ @ManyToOne
@JoinColumn(name="TEAM_ID")
private Team team;
+
+ public Membre() {
+ }
+
+ public Membre(String nom, String prenom, LocalDate dateNaissance, String email, String password, String isAdmin, String couleur, String smiley, Team team) {
+ this.nom = nom;
+ this.prenom = prenom;
+ this.dateNaissance = dateNaissance;
+ this.email = email;
+ this.password = password;
+ this.isAdmin = isAdmin;
+ this.couleur = couleur;
+ this.smiley = smiley;
+/* this.team = team;*/
+ }
+
+ public int getId() {
+ return id;
+ }
+ public void setId(int id) {
+ this.id = id;
+ }
+ 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;
+ }
+ public LocalDate getDateNaissance() {
+ return dateNaissance;
+ }
+ public void setDateNaissance(LocalDate dateNaissance) {
+ this.dateNaissance = dateNaissance;
+ }
+ public String getEmail() {
+ return email;
+ }
+ public void setEmail(String email) {
+ this.email = email;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+ public String getIsAdmin() {
+ return isAdmin;
+ }
+ public void setIsAdmin(String isAdmin) {
+ this.isAdmin = isAdmin;
+ }
+
+ public Team getTeam() {
+ return team;
+ }
+ public void setTeam(Team team) {
+ this.team = team;
+ }
+
+ public String getCouleur() {
+ return couleur;
+ }
+
+ public void setCouleur(String couleur) {
+ this.couleur = couleur;
+ }
+
+ public String getSmiley() {
+ return smiley;
+ }
+
+ public void setSmiley(String smiley) {
+ this.smiley = smiley;
+ }
+
+ @Override
+ public String toString() {
+ return "Membre{" +
+ "id=" + id +
+ ", nom='" + nom + '\'' +
+ ", prenom='" + prenom + '\'' +
+ ", dateNaissance=" + dateNaissance +
+ ", email='" + email + '\'' +
+ ", password='" + password + '\'' +
+ ", isAdmin='" + isAdmin + '\'' +
+ ", couleur='" + couleur + '\'' +
+ ", smiley='" + smiley + '\'' +
+ /*", team=" + team +*/
+ '}';
+ }
}
+
diff --git a/src/main/java/fr/organizee/model/Menu.java b/src/main/java/fr/organizee/model/Menu.java
new file mode 100644
index 0000000..0444921
--- /dev/null
+++ b/src/main/java/fr/organizee/model/Menu.java
@@ -0,0 +1,58 @@
+package fr.organizee.model;
+
+import javax.persistence.*;
+import java.time.LocalDate;
+
+@Entity
+public class Menu {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private int id;
+ private String libelle;
+ private LocalDate dateMenu;
+ @ManyToOne
+ private Team team;
+ @ManyToOne
+ private Membre membre;
+
+ public Menu() {
+ }
+
+ public Menu(String libelle, LocalDate dateMenu) {
+ this.libelle = libelle;
+ this.dateMenu = dateMenu;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getLibelle() {
+ return libelle;
+ }
+
+ public void setLibelle(String libelle) {
+ this.libelle = libelle;
+ }
+
+ public LocalDate getDateMenu() {
+ return dateMenu;
+ }
+
+ public void setDateMenu(LocalDate dateMenu) {
+ this.dateMenu = dateMenu;
+ }
+
+ @Override
+ public String toString() {
+ return "Menu{" +
+ "id=" + id +
+ ", libelle='" + libelle + '\'' +
+ ", dateMenu=" + dateMenu +
+ '}';
+ }
+}
diff --git a/src/main/java/fr/organizee/model/Tache.java b/src/main/java/fr/organizee/model/Tache.java
new file mode 100644
index 0000000..28dd8b1
--- /dev/null
+++ b/src/main/java/fr/organizee/model/Tache.java
@@ -0,0 +1,56 @@
+package fr.organizee.model;
+
+import javax.persistence.*;
+
+@Entity
+public class Tache {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private int id;
+ private String texte;
+ private boolean etat;
+ @ManyToOne
+ @JoinColumn(name = "todolist_id")
+ private TodoList todolist;
+
+ public Tache(String texte, boolean etat) {
+ this.texte = texte;
+ this.etat = etat;
+ }
+
+ public Tache() {
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getTexte() {
+ return texte;
+ }
+
+ public void setTexte(String texte) {
+ this.texte = texte;
+ }
+
+ public boolean isEtat() {
+ return etat;
+ }
+
+ public void setEtat(boolean etat) {
+ this.etat = etat;
+ }
+
+ @Override
+ public String toString() {
+ return "Tache{" +
+ "id=" + id +
+ ", texte='" + texte + '\'' +
+ ", etat=" + etat +
+ '}';
+ }
+}
diff --git a/src/main/java/fr/organizee/model/Team.java b/src/main/java/fr/organizee/model/Team.java
index ac4546f..ce562e2 100644
--- a/src/main/java/fr/organizee/model/Team.java
+++ b/src/main/java/fr/organizee/model/Team.java
@@ -10,6 +10,51 @@ public class Team {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String nom;
+ @OneToMany(mappedBy = "team", cascade = CascadeType.ALL, orphanRemoval = true)
+ //@OneToMany
+ private List membres = new ArrayList<>();
@OneToMany
- private List membre = new ArrayList<>();
+ @JoinTable(name = "repertoire")
+ private List contacts = new ArrayList<>();
+ @OneToMany
+ @JoinTable(name = "team_todolist")
+ private List todolists = new ArrayList<>();
+ @OneToMany
+ @JoinTable(name="team_menu")
+ private List