aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/terminaldweller/doc/DocController.java
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-05-18 14:43:24 +0000
committerterminaldweller <thabogre@gmail.com>2022-05-18 14:43:24 +0000
commit52c86c942bae1e0e5e7ba97ea93efafbd4c198dd (patch)
treeb1aa9b9b8c8104bb9ac787b399a12133e153e4b1 /src/main/java/com/terminaldweller/doc/DocController.java
parentsome fixes (diff)
downloadmdrtl-52c86c942bae1e0e5e7ba97ea93efafbd4c198dd.tar.gz
mdrtl-52c86c942bae1e0e5e7ba97ea93efafbd4c198dd.zip
CRUD tested and working
Diffstat (limited to 'src/main/java/com/terminaldweller/doc/DocController.java')
-rw-r--r--src/main/java/com/terminaldweller/doc/DocController.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/terminaldweller/doc/DocController.java b/src/main/java/com/terminaldweller/doc/DocController.java
index e73ef41..39ddfe9 100644
--- a/src/main/java/com/terminaldweller/doc/DocController.java
+++ b/src/main/java/com/terminaldweller/doc/DocController.java
@@ -1,6 +1,6 @@
package com.terminaldweller.doc;
-import java.util.List;
+import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -24,9 +24,9 @@ public class DocController {
this.docService = docService;
}
- @GetMapping
- public List<Doc> getDocs() {
- return docService.getDocs();
+ @GetMapping(path = "{Id}")
+ public Optional<Doc> getDocs(@PathVariable("Id") Long id) {
+ return docService.getDocs(id);
}
@PostMapping