diff options
author | terminaldweller <thabogre@gmail.com> | 2022-05-03 10:28:42 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-05-03 10:28:42 +0000 |
commit | 056dcb5b4fda70f963bfb392fcd2816170f2bc12 (patch) | |
tree | cf79d8f2ef8cbfe574d59b9d785dbb52496aff4d /src/main/java/com/terminaldweller/doc/DocController.java | |
parent | update (diff) | |
download | mdrtl-056dcb5b4fda70f963bfb392fcd2816170f2bc12.tar.gz mdrtl-056dcb5b4fda70f963bfb392fcd2816170f2bc12.zip |
added PUT, the CRUD is done now. just need to test the crud
Diffstat (limited to 'src/main/java/com/terminaldweller/doc/DocController.java')
-rw-r--r-- | src/main/java/com/terminaldweller/doc/DocController.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/terminaldweller/doc/DocController.java b/src/main/java/com/terminaldweller/doc/DocController.java index a91fb0d..e73ef41 100644 --- a/src/main/java/com/terminaldweller/doc/DocController.java +++ b/src/main/java/com/terminaldweller/doc/DocController.java @@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; @@ -38,4 +39,9 @@ public class DocController { public void deleteDocs(@PathVariable("Id") Long id) { docService.deleteDoc(id); } + + @PutMapping(path = "{Id}") + public void updatDoc(@RequestBody Doc doc, @PathVariable("Id") long id) { + docService.updateDoc(doc, id); + } } |