From 072192642353e57722db71598e134371c54b68e7 Mon Sep 17 00:00:00 2001 From: Uzma Ferdaus Date: Mon, 20 Jan 2020 22:27:19 -0800 Subject: [PATCH 1/5] Updated the get-method in controller --- .../java/com/example/easynotes/controller/IndexController.java | 1 + .../java/com/example/easynotes/controller/NoteController.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/easynotes/controller/IndexController.java b/src/main/java/com/example/easynotes/controller/IndexController.java index f9c5ea4..f96546d 100644 --- a/src/main/java/com/example/easynotes/controller/IndexController.java +++ b/src/main/java/com/example/easynotes/controller/IndexController.java @@ -13,4 +13,5 @@ public class IndexController { public String sayHello() { return "Hello and Welcome to the EasyNotes application. You can create a new Note by making a POST request to /api/notes endpoint."; } + } diff --git a/src/main/java/com/example/easynotes/controller/NoteController.java b/src/main/java/com/example/easynotes/controller/NoteController.java index 52f2ef0..e0fc9f9 100644 --- a/src/main/java/com/example/easynotes/controller/NoteController.java +++ b/src/main/java/com/example/easynotes/controller/NoteController.java @@ -11,7 +11,6 @@ import java.util.List; /** - * Created by rajeevkumarsingh on 27/06/17. */ @RestController @RequestMapping("/api") @@ -22,7 +21,9 @@ public class NoteController { @GetMapping("/notes") public List getAllNotes() { + System.out.println("GetMapping"); return noteRepository.findAll(); + } @PostMapping("/notes") From 18ea556d2e6696c7f003b0d5853845a86fc8db9e Mon Sep 17 00:00:00 2001 From: Uzma Ferdaus Date: Mon, 20 Jan 2020 22:27:19 -0800 Subject: [PATCH 2/5] Updated the get-method in controller --- .../java/com/example/easynotes/controller/IndexController.java | 1 + .../java/com/example/easynotes/controller/NoteController.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/easynotes/controller/IndexController.java b/src/main/java/com/example/easynotes/controller/IndexController.java index f9c5ea4..f96546d 100644 --- a/src/main/java/com/example/easynotes/controller/IndexController.java +++ b/src/main/java/com/example/easynotes/controller/IndexController.java @@ -13,4 +13,5 @@ public class IndexController { public String sayHello() { return "Hello and Welcome to the EasyNotes application. You can create a new Note by making a POST request to /api/notes endpoint."; } + } diff --git a/src/main/java/com/example/easynotes/controller/NoteController.java b/src/main/java/com/example/easynotes/controller/NoteController.java index 52f2ef0..e0fc9f9 100644 --- a/src/main/java/com/example/easynotes/controller/NoteController.java +++ b/src/main/java/com/example/easynotes/controller/NoteController.java @@ -11,7 +11,6 @@ import java.util.List; /** - * Created by rajeevkumarsingh on 27/06/17. */ @RestController @RequestMapping("/api") @@ -22,7 +21,9 @@ public class NoteController { @GetMapping("/notes") public List getAllNotes() { + System.out.println("GetMapping"); return noteRepository.findAll(); + } @PostMapping("/notes") From f928d74b11d9791e5dbeddf3e181c833885dc029 Mon Sep 17 00:00:00 2001 From: Uzma Ferdaus Date: Mon, 20 Jan 2020 22:35:46 -0800 Subject: [PATCH 3/5] updated main class --- src/main/java/com/example/easynotes/EasyNotesApplication.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/example/easynotes/EasyNotesApplication.java b/src/main/java/com/example/easynotes/EasyNotesApplication.java index af3b8dd..4194fa9 100644 --- a/src/main/java/com/example/easynotes/EasyNotesApplication.java +++ b/src/main/java/com/example/easynotes/EasyNotesApplication.java @@ -10,5 +10,6 @@ public class EasyNotesApplication { public static void main(String[] args) { SpringApplication.run(EasyNotesApplication.class, args); + System.out.println("Hello World"); } } From c9b8fd8e6bb11e050d88cbb32493636dc767d5c2 Mon Sep 17 00:00:00 2001 From: Uzma Ferdaus Date: Mon, 20 Jan 2020 23:37:10 -0800 Subject: [PATCH 4/5] Added in get method of notescontroller --- .../java/com/example/easynotes/controller/NoteController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/example/easynotes/controller/NoteController.java b/src/main/java/com/example/easynotes/controller/NoteController.java index e0fc9f9..679c2b7 100644 --- a/src/main/java/com/example/easynotes/controller/NoteController.java +++ b/src/main/java/com/example/easynotes/controller/NoteController.java @@ -22,6 +22,7 @@ public class NoteController { @GetMapping("/notes") public List getAllNotes() { System.out.println("GetMapping"); + System.out.println("Hello"); return noteRepository.findAll(); } From 2fea3976b4ddca2afe161337bf8c8f5bf5e7653a Mon Sep 17 00:00:00 2001 From: Uzma Ferdaus Date: Tue, 21 Jan 2020 01:13:19 -0800 Subject: [PATCH 5/5] Added in postmethod --- .../java/com/example/easynotes/controller/NoteController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/example/easynotes/controller/NoteController.java b/src/main/java/com/example/easynotes/controller/NoteController.java index 679c2b7..6f31e3d 100644 --- a/src/main/java/com/example/easynotes/controller/NoteController.java +++ b/src/main/java/com/example/easynotes/controller/NoteController.java @@ -29,6 +29,7 @@ public List getAllNotes() { @PostMapping("/notes") public Note createNote(@Valid @RequestBody Note note) { + System.out.println("Added in post"); return noteRepository.save(note); }