From b874fb16a24c7c6eddd48715af03ae1cffa5cea4 Mon Sep 17 00:00:00 2001 From: AlineRinquin <90188226+AlineRinquin@users.noreply.github.com> Date: Thu, 20 Jan 2022 09:37:14 +0100 Subject: [PATCH 1/5] commit pour pull --- .idea/Organizee.iml | 9 --------- .idea/compiler.xml | 2 ++ pom.xml | 13 +++++++------ 3 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 .idea/Organizee.iml diff --git a/.idea/Organizee.iml b/.idea/Organizee.iml deleted file mode 100644 index d6ebd48..0000000 --- a/.idea/Organizee.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index a8c4885..c75fd2a 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,11 +6,13 @@ + diff --git a/pom.xml b/pom.xml index 32eb628..9b437f5 100644 --- a/pom.xml +++ b/pom.xml @@ -2,12 +2,7 @@ 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.6.1 - - + fr.organizee organizee 0.0.1-SNAPSHOT @@ -16,6 +11,12 @@ 11 + + org.springframework.boot + spring-boot-starter-parent + 2.6.1 + + org.springframework.boot From 8a96240fd691befe8beea99d2ec4c3256b952252 Mon Sep 17 00:00:00 2001 From: AlineRinquin <90188226+AlineRinquin@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:39:49 +0100 Subject: [PATCH 2/5] =?UTF-8?q?ALINE:controller=20contact=20blocage=20pr?= =?UTF-8?q?=C3=A9authorize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/organizee/controller/ContactController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/organizee/controller/ContactController.java b/src/main/java/fr/organizee/controller/ContactController.java index ef79042..e93e926 100644 --- a/src/main/java/fr/organizee/controller/ContactController.java +++ b/src/main/java/fr/organizee/controller/ContactController.java @@ -21,7 +21,7 @@ public class ContactController { private ContactRepository contactRepo; @GetMapping(value = "/{id}") - @PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')") + //@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')") public ResponseEntity findById(@PathVariable int id){ Optional contact = null; try @@ -35,7 +35,7 @@ public class ContactController { } @GetMapping(value = "team/{team_id}") - @PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')") + //@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')") public ResponseEntity findByTeamId(@PathVariable int team_id){ List contacts = null; try @@ -49,7 +49,7 @@ public class ContactController { } @PostMapping(value="/add") - @PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')") + //@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')") public ResponseEntity addContact(@RequestBody Contact contact){ Contact resultContact = null; try { @@ -62,7 +62,7 @@ public class ContactController { } @PutMapping("/update/{id}") - @PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')") + //@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')") public ResponseEntity updateContact(@RequestBody Contact contact, @PathVariable Integer id) throws Exception { Contact resultContact = null; try { @@ -76,7 +76,7 @@ public class ContactController { } @DeleteMapping(value = "/delete/{id}") - @PreAuthorize("hasRole('ROLE_PARENT')") + //@PreAuthorize("hasRole('ROLE_PARENT')") public ResponseEntity deleteContact(@PathVariable int id){ try { contactRepo.delete(contactRepo.getById(id)); From 31ec70f02e5f46174536ed4797f10e78061587be Mon Sep 17 00:00:00 2001 From: HarmandI Date: Tue, 15 Feb 2022 15:39:35 +0100 Subject: [PATCH 3/5] addTache --- .../java/fr/organizee/controller/TacheController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/organizee/controller/TacheController.java b/src/main/java/fr/organizee/controller/TacheController.java index 681d760..82ce274 100644 --- a/src/main/java/fr/organizee/controller/TacheController.java +++ b/src/main/java/fr/organizee/controller/TacheController.java @@ -1,6 +1,7 @@ package fr.organizee.controller; import fr.organizee.model.Tache; +import fr.organizee.model.TodoList; import fr.organizee.repository.TacheRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -61,10 +62,13 @@ public class TacheController { } // Ajoute une tache - @PostMapping(value="/add", produces="application/json", consumes="application/json") - public ResponseEntity addTache(@RequestBody Tache tache){ + @PostMapping(value="/add/{idTodoList}", produces="application/json", consumes="application/json") + public ResponseEntity addTache(@RequestBody Tache tache,@PathVariable Integer idTodoList){ Tache resultTache = null; try { + TodoList todolist=new TodoList(); + todolist.setId(idTodoList); + tache.setTodolist(todolist); resultTache = tacheRepo.saveAndFlush(tache); } catch (Exception e) { return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(e.getMessage()); From 54bf69a436d93b28c1d014c108a8d597022fbada Mon Sep 17 00:00:00 2001 From: AlineRinquin Date: Thu, 17 Feb 2022 10:40:56 +0100 Subject: [PATCH 4/5] modification des contact ajout couleur --- .idea/misc.xml | 3 +++ src/main/java/fr/organizee/model/Contact.java | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 06e8b35..2289c27 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -11,4 +11,7 @@ + + \ No newline at end of file diff --git a/src/main/java/fr/organizee/model/Contact.java b/src/main/java/fr/organizee/model/Contact.java index 826b2db..25b2d2d 100644 --- a/src/main/java/fr/organizee/model/Contact.java +++ b/src/main/java/fr/organizee/model/Contact.java @@ -11,6 +11,7 @@ public class Contact { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; + private String couleur; private String nom; private String prenom; private String telephone; @@ -18,14 +19,15 @@ public class Contact { private String adresse; private LocalDate dateNaissance; @ManyToOne - @JoinColumn(name="TEAM_ID") - @JsonIgnoreProperties({"contact","membre"}) + @JoinColumn(name = "TEAM_ID") + @JsonIgnoreProperties({"contact", "membre"}) private Team team; public Contact() { } - public Contact(String nom, String prenom, String telephone, String email, String adresse, LocalDate dateNaissance, Team team) { + public Contact(String couleur, String nom, String prenom, String telephone, String email, String adresse, LocalDate dateNaissance, Team team) { + this.couleur = couleur; this.nom = nom; this.prenom = prenom; this.telephone = telephone; @@ -43,6 +45,14 @@ public class Contact { this.id = id; } + public String getCouleur() { + return couleur; + } + + public void setCouleur(String couleur) { + this.couleur = couleur; + } + public String getNom() { return nom; } @@ -94,6 +104,7 @@ public class Contact { public Team getTeam() { return team; } + public void setTeam(Team team) { this.team = team; } @@ -102,6 +113,7 @@ public class Contact { public String toString() { return "Contact{" + "id=" + id + + ", couleur='" + couleur + '\'' + ", nom='" + nom + '\'' + ", prenom='" + prenom + '\'' + ", telephone='" + telephone + '\'' + From eb7b7777ec8b3a755b31784f947825923a4f8589 Mon Sep 17 00:00:00 2001 From: HarmandI Date: Thu, 17 Feb 2022 11:38:46 +0100 Subject: [PATCH 5/5] update tache --- src/main/java/fr/organizee/controller/TacheController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/organizee/controller/TacheController.java b/src/main/java/fr/organizee/controller/TacheController.java index 82ce274..58e5ccc 100644 --- a/src/main/java/fr/organizee/controller/TacheController.java +++ b/src/main/java/fr/organizee/controller/TacheController.java @@ -77,11 +77,14 @@ public class TacheController { return ResponseEntity.status(HttpStatus.CREATED).body(resultTache); } - //Met a jour les informations d'une date avec son ID + //Met a jour les informations d'une tache avec son ID @PutMapping("/update/{id}") public ResponseEntity updateTache(@RequestBody Tache tache, @PathVariable Integer id) throws Exception { Tache resultTache = null; try { + TodoList todolist=new TodoList(); + todolist.setId(tacheRepo.findById(tache.getId()).get().getTodolist().getId()); + tache.setTodolist(todolist); resultTache = tacheRepo.save(tache); } catch (Exception e) {