11package no.nav.klage.document.api
22
3+ import io.swagger.annotations.ApiOperation
34import no.nav.klage.document.api.views.CommentInput
45import no.nav.klage.document.api.views.CommentView
56import no.nav.klage.document.api.views.DocumentView
@@ -23,6 +24,10 @@ class DocumentController(
2324 private val logger = getLogger(javaClass.enclosingClass)
2425 }
2526
27+ @ApiOperation(
28+ value = " Create document" ,
29+ notes = " Create document"
30+ )
2631 @PostMapping(" /" )
2732 fun createDocument (
2833 @RequestBody json : String
@@ -31,12 +36,20 @@ class DocumentController(
3136 return mapToDocumentView(documentService.createDocument(json))
3237 }
3338
39+ @ApiOperation(
40+ value = " Get document" ,
41+ notes = " Get document"
42+ )
3443 @GetMapping(" /{documentId}" )
3544 fun getDocument (@PathVariable(" documentId" ) documentId : UUID ): DocumentView {
3645 logger.debug(" getDocument" )
3746 return mapToDocumentView(documentService.getDocument(documentId))
3847 }
3948
49+ @ApiOperation(
50+ value = " Create comment for a given document" ,
51+ notes = " Create comment for a given document"
52+ )
4053 @PostMapping(" /{documentId}/comments" )
4154 fun createComment (
4255 @PathVariable(" documentId" ) documentId : UUID ,
@@ -53,6 +66,10 @@ class DocumentController(
5366 )
5467 }
5568
69+ @ApiOperation(
70+ value = " Get all comments for a given document" ,
71+ notes = " Get all comments for a given document"
72+ )
5673 @GetMapping(" /{documentId}/comments" )
5774 fun getAllCommentsWithPossibleThreads (
5875 @PathVariable(" documentId" ) documentId : UUID
@@ -61,6 +78,10 @@ class DocumentController(
6178 return commentService.getComments(documentId).map { mapCommentToView(it) }
6279 }
6380
81+ @ApiOperation(
82+ value = " Reply to a given comment" ,
83+ notes = " Reply to a given comment"
84+ )
6485 @PostMapping(" /{documentId}/comments/{commentId}" )
6586 fun replyToComment (
6687 @PathVariable(" documentId" ) documentId : UUID ,
@@ -79,6 +100,10 @@ class DocumentController(
79100 )
80101 }
81102
103+ @ApiOperation(
104+ value = " Get a given comment" ,
105+ notes = " Get a given comment"
106+ )
82107 @GetMapping(" /{documentId}/comments/{commentId}" )
83108 fun getCommentWithPossibleThread (
84109 @PathVariable(" documentId" ) documentId : UUID ,
0 commit comments