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/src/main/java/fr/organizee/model/Contact.java b/src/main/java/fr/organizee/model/Contact.java new file mode 100644 index 0000000..35a57ec --- /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 c99664f..cccd898 100644 --- a/src/main/java/fr/organizee/model/Membre.java +++ b/src/main/java/fr/organizee/model/Membre.java @@ -15,7 +15,97 @@ public class Membre { private String email; private String password; private String isAdmin; + private String couleur; @ManyToOne(fetch= FetchType.EAGER) @JoinColumn(name="TEAM_ID") private Team team; +// @ManyToOne +// private Smiley smiley; + + public Membre() { + } + + public Membre(String nom, String prenom, LocalDate dateNaissance, String email, String password, String isAdmin, String couleur, Team team) { + this.nom = nom; + this.prenom = prenom; + this.dateNaissance = dateNaissance; + this.email = email; + this.password = password; + this.isAdmin = isAdmin; + this.couleur = couleur; + 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; + } + + @Override + public String toString() { + return "Membre{" + + "id=" + id + + ", nom='" + nom + '\'' + + ", prenom='" + prenom + '\'' + + ", dateNaissance=" + dateNaissance + + ", email='" + email + '\'' + + ", password='" + password + '\'' + + ", isAdmin='" + isAdmin + '\'' + + ", couleur='" + couleur + '\'' + + ", 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..4a4fc92 --- /dev/null +++ b/src/main/java/fr/organizee/model/Menu.java @@ -0,0 +1,55 @@ +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; + + + 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/Smiley.java b/src/main/java/fr/organizee/model/Smiley.java new file mode 100644 index 0000000..59cb411 --- /dev/null +++ b/src/main/java/fr/organizee/model/Smiley.java @@ -0,0 +1,46 @@ +package fr.organizee.model; + +import javax.persistence.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +public class Smiley { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + private String smileyUrl; + @OneToMany + private List membres = new ArrayList<>(); + + public Smiley() { + } + + public Smiley(String smileyUrl) { + this.smileyUrl = smileyUrl; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getSmileyUrl() { + return smileyUrl; + } + + public void setSmileyUrl(String smileyUrl) { + this.smileyUrl = smileyUrl; + } + + @Override + public String toString() { + return "Smiley{" + + "id=" + id + + ", smileyUrl='" + smileyUrl + '\'' + + '}'; + } +} 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..fb2755c 100644 --- a/src/main/java/fr/organizee/model/Team.java +++ b/src/main/java/fr/organizee/model/Team.java @@ -11,5 +11,46 @@ public class Team { private int id; private String nom; @OneToMany - private List membre = new ArrayList<>(); + private List membres = new ArrayList<>(); + @OneToMany + @JoinTable(name = "repertoire") + private List contacts = new ArrayList<>(); + @OneToMany + @JoinTable(name = "team_todolist") + private List todolists = new ArrayList<>(); + + public Team() { + super(); + } + + public Team(int id, String nom, List membre) { + super(); + this.id = id; + this.nom = nom; + this.membres = membre; + } + + 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 List getMembre() { + return membres; + } + public void setMembre(List membre) { + this.membres = membre; + } + + @Override + public String toString() { + return "Team [id=" + id + ", nom=" + nom + ", membre=" + membres + "]"; + } } diff --git a/src/main/java/fr/organizee/model/TodoList.java b/src/main/java/fr/organizee/model/TodoList.java new file mode 100644 index 0000000..c86b70c --- /dev/null +++ b/src/main/java/fr/organizee/model/TodoList.java @@ -0,0 +1,46 @@ +package fr.organizee.model; + +import javax.persistence.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +public class TodoList { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + private String nom; + @OneToMany(mappedBy = "todolist") + private List taches = new ArrayList<>(); + + public TodoList() { + } + + public TodoList(String nom) { + this.nom = nom; + } + + 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; + } + + @Override + public String toString() { + return "TodoList{" + + "id=" + id + + ", nom='" + nom + '\'' + + '}'; + } +} diff --git a/src/main/java/fr/organizee/repository/ContactRepository.java b/src/main/java/fr/organizee/repository/ContactRepository.java new file mode 100644 index 0000000..b670634 --- /dev/null +++ b/src/main/java/fr/organizee/repository/ContactRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface ContactRepository { +} diff --git a/src/main/java/fr/organizee/repository/MembreRepository.java b/src/main/java/fr/organizee/repository/MembreRepository.java new file mode 100644 index 0000000..a469a02 --- /dev/null +++ b/src/main/java/fr/organizee/repository/MembreRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface MembreRepository { +} diff --git a/src/main/java/fr/organizee/repository/MenuRepository.java b/src/main/java/fr/organizee/repository/MenuRepository.java new file mode 100644 index 0000000..b9bb652 --- /dev/null +++ b/src/main/java/fr/organizee/repository/MenuRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface MenuRepository { +} diff --git a/src/main/java/fr/organizee/repository/SmileyRepository.java b/src/main/java/fr/organizee/repository/SmileyRepository.java new file mode 100644 index 0000000..f4d2d5d --- /dev/null +++ b/src/main/java/fr/organizee/repository/SmileyRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface SmileyRepository { +} diff --git a/src/main/java/fr/organizee/repository/TacheRepository.java b/src/main/java/fr/organizee/repository/TacheRepository.java new file mode 100644 index 0000000..17c22b8 --- /dev/null +++ b/src/main/java/fr/organizee/repository/TacheRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface TacheRepository { +} diff --git a/src/main/java/fr/organizee/repository/TeamRepository.java b/src/main/java/fr/organizee/repository/TeamRepository.java new file mode 100644 index 0000000..433e4d2 --- /dev/null +++ b/src/main/java/fr/organizee/repository/TeamRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface TeamRepository { +} diff --git a/src/main/java/fr/organizee/repository/TodoListRepository.java b/src/main/java/fr/organizee/repository/TodoListRepository.java new file mode 100644 index 0000000..2a0cd58 --- /dev/null +++ b/src/main/java/fr/organizee/repository/TodoListRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface TodoListRepository { +}