diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/com/terminaldweller/doc/Doc.java | 1 | ||||
-rw-r--r-- | src/main/java/com/terminaldweller/doc/DocService.java | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/terminaldweller/doc/Doc.java b/src/main/java/com/terminaldweller/doc/Doc.java index 80247eb..35ee5fd 100644 --- a/src/main/java/com/terminaldweller/doc/Doc.java +++ b/src/main/java/com/terminaldweller/doc/Doc.java @@ -25,6 +25,7 @@ public class Doc { * @param id the id given by the db. * @param name the name of the documment given by the user. * @param lastModified the date of the last modification in unix epoch. + * @param body the actual text of the document. */ public Doc(Long id, String name, long lastModified, String body) { this.id = id; diff --git a/src/main/java/com/terminaldweller/doc/DocService.java b/src/main/java/com/terminaldweller/doc/DocService.java index df4456e..a885b9a 100644 --- a/src/main/java/com/terminaldweller/doc/DocService.java +++ b/src/main/java/com/terminaldweller/doc/DocService.java @@ -14,6 +14,12 @@ public class DocService { this.docRepository = docRepository; } + /** + * get a document by its id. + * + * @param id of the document to get. + * @return returns the found doc if any. + */ public Optional<Doc> getDocs(Long id) { Optional<Doc> docOptional = docRepository.findById(id); if (docOptional.isPresent()) { @@ -26,6 +32,7 @@ public class DocService { * Adds a new Document to the data store. * * @param doc the new Document to add. + * @param id the id of the document that's going to be created. */ public void addNewDoc(Long id, Doc doc) { // Optional<Doc> docOptional = docRepository.findDocByName(doc.getName()); @@ -41,6 +48,7 @@ public class DocService { * Update a Document. * * @param doc the document to update. + * @param id the id of the document to be updated. */ public void updateDoc(Doc doc, Long id) { Optional<Doc> docOptional = docRepository.findById(id); |