From 87bbec1ba18c0e2e1d9728c5c5aba18adb5ab9b7 Mon Sep 17 00:00:00 2001 From: Blandine Bajard <83599148+BlandineBajard@users.noreply.github.com> Date: Thu, 24 Feb 2022 12:14:50 +0100 Subject: [PATCH 1/3] changement back sur le menu --- .../controller/MembreController.java | 2 +- src/main/java/fr/organizee/model/Menu.java | 44 ++++++++----------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/main/java/fr/organizee/controller/MembreController.java b/src/main/java/fr/organizee/controller/MembreController.java index 6c088c4..4164834 100644 --- a/src/main/java/fr/organizee/controller/MembreController.java +++ b/src/main/java/fr/organizee/controller/MembreController.java @@ -160,7 +160,7 @@ public class MembreController { membreRepo.deleteById(id); return ResponseEntity.status(HttpStatus.OK).body("Membre supprimé !"); } catch (Exception e) { - MembreNotFoundException membreNotFoundException = new membreNotFoundException(id); + MembreNotFoundException membreNotFoundException = new MembreNotFoundException(id); return ResponseEntity.status(HttpStatus.NOT_FOUND).body(membreNotFoundException.getMessage()); } } diff --git a/src/main/java/fr/organizee/model/Menu.java b/src/main/java/fr/organizee/model/Menu.java index 458e80c..4be974c 100644 --- a/src/main/java/fr/organizee/model/Menu.java +++ b/src/main/java/fr/organizee/model/Menu.java @@ -10,10 +10,9 @@ public class Menu { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; - private String libelle; private LocalDate dateMenu; - private String repas; - // private int validationProposition; + private String repasMidi; + private String repasSoir; @ManyToOne @JoinColumn(name="TEAM_ID") @JsonIgnoreProperties({"menu","membre"}) @@ -22,10 +21,10 @@ public class Menu { public Menu() { } - public Menu(String libelle, LocalDate dateMenu,String repas, Team team) { - this.libelle = libelle; + public Menu(LocalDate dateMenu,String repasMidi, String repasSoir, Team team) { this.dateMenu = dateMenu; - this.repas= repas; + this.repasMidi= repasMidi; + this.repasSoir= repasSoir; this.team = team; } @@ -37,14 +36,6 @@ public class Menu { this.id = id; } - public String getLibelle() { - return libelle; - } - - public void setLibelle(String libelle) { - this.libelle = libelle; - } - public LocalDate getDateMenu() { return dateMenu; } @@ -53,21 +44,21 @@ public class Menu { this.dateMenu = dateMenu; } - public String getRepas() { - return repas; + public String getRepasMidi() { + return repasMidi; } - public void setRepas(String repas) { - this.repas = repas; + public void setRepasMidi(String repasMidi) { + this.repasMidi = repasMidi; } - // public int getValidationProposition() { - // return validationProposition; - //} + public String getRepasSoir() { + return repasSoir; + } - //public void setValidationProposition(int validationProposition) { - // this.validationProposition = validationProposition; - // } + public void setRepasSoir(String repasSoir) { + this.repasSoir = repasSoir; + } public Team getTeam() { return team; @@ -77,14 +68,15 @@ public class Menu { this.team = team; } + @Override public String toString() { return "Menu{" + "id=" + id + - ", libelle='" + libelle + '\'' + ", dateMenu=" + dateMenu + + ", repasMidi='" + repasMidi + '\'' + + ", repasSoir='" + repasSoir + '\'' + ", team=" + team + - ", repas=" + repas + '}'; } } From 45cecb0079a6c73a06e799efd15a45c4f4d7573f Mon Sep 17 00:00:00 2001 From: AlineRinquin Date: Thu, 24 Feb 2022 13:35:05 +0100 Subject: [PATCH 2/3] mise a jour fichier sana --- src/main/java/fr/organizee/controller/MembreController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/fr/organizee/controller/MembreController.java b/src/main/java/fr/organizee/controller/MembreController.java index 6c088c4..4164834 100644 --- a/src/main/java/fr/organizee/controller/MembreController.java +++ b/src/main/java/fr/organizee/controller/MembreController.java @@ -160,7 +160,7 @@ public class MembreController { membreRepo.deleteById(id); return ResponseEntity.status(HttpStatus.OK).body("Membre supprimé !"); } catch (Exception e) { - MembreNotFoundException membreNotFoundException = new membreNotFoundException(id); + MembreNotFoundException membreNotFoundException = new MembreNotFoundException(id); return ResponseEntity.status(HttpStatus.NOT_FOUND).body(membreNotFoundException.getMessage()); } } From 03c8a9dfc3588297c3419dc3e7beac75ae2dbd4a Mon Sep 17 00:00:00 2001 From: AlineRinquin Date: Thu, 24 Feb 2022 14:59:51 +0100 Subject: [PATCH 3/3] data sql menu ajour --- src/main/resources/data.sql | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index 4bc52c5..148a508 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -41,6 +41,12 @@ INSERT INTO `evenement` (`id`, `all_day`, `start`, `end`, `text`, `membre_id`, ` (1, 0, '2022-02-04 09:00:00', '2022-02-04 13:00:00', 'Simplon', 1, 1), (2, 0, '2022-02-03 12:00:00', '2022-02-03 13:00:00', 'Footing', 2, 1); -INSERT INTO `menu` (`id`, `date_menu`, `libelle`, `validation_proposition`, `team_id`) VALUES - (1, '2022-01-13', 'Lasagnes', 1, 1), - (2, '2022-01-03', 'Kebab', 1, 1); \ No newline at end of file + +INSERT INTO menu (id, date_menu, repas_midi, team_id, repas_soir) VALUES +(1, '2022-02-21', 'canard à l orange', 4, 'pâtes au beurre'), +(4, '2022-02-22', 'lasagnes', 4, 'riz sauté'), +(11, '2022-02-23', 'roti de dinde orloff', 4, 'choucroute'), +(13, '2022-02-24', 'hachis parmentier', 4, 'salade composée'), +(15, '2022-02-25', 'legumes', 4, 'croque monsieurs'), +(17, '2022-02-26', 'sauté de veau', 4, 'soupe et jambon'), +(21, '2022-02-27', 'lasagnes', 4, 'pizza'); \ No newline at end of file