1
1
package no.nav.klage.document.api
2
2
3
+ import io.swagger.annotations.ApiOperation
3
4
import no.nav.klage.document.api.views.CommentInput
4
5
import no.nav.klage.document.api.views.CommentView
5
6
import no.nav.klage.document.api.views.DocumentView
@@ -23,6 +24,10 @@ class DocumentController(
23
24
private val logger = getLogger(javaClass.enclosingClass)
24
25
}
25
26
27
+ @ApiOperation(
28
+ value = " Create document" ,
29
+ notes = " Create document"
30
+ )
26
31
@PostMapping(" /" )
27
32
fun createDocument (
28
33
@RequestBody json : String
@@ -31,12 +36,20 @@ class DocumentController(
31
36
return mapToDocumentView(documentService.createDocument(json))
32
37
}
33
38
39
+ @ApiOperation(
40
+ value = " Get document" ,
41
+ notes = " Get document"
42
+ )
34
43
@GetMapping(" /{documentId}" )
35
44
fun getDocument (@PathVariable(" documentId" ) documentId : UUID ): DocumentView {
36
45
logger.debug(" getDocument" )
37
46
return mapToDocumentView(documentService.getDocument(documentId))
38
47
}
39
48
49
+ @ApiOperation(
50
+ value = " Create comment for a given document" ,
51
+ notes = " Create comment for a given document"
52
+ )
40
53
@PostMapping(" /{documentId}/comments" )
41
54
fun createComment (
42
55
@PathVariable(" documentId" ) documentId : UUID ,
@@ -53,6 +66,10 @@ class DocumentController(
53
66
)
54
67
}
55
68
69
+ @ApiOperation(
70
+ value = " Get all comments for a given document" ,
71
+ notes = " Get all comments for a given document"
72
+ )
56
73
@GetMapping(" /{documentId}/comments" )
57
74
fun getAllCommentsWithPossibleThreads (
58
75
@PathVariable(" documentId" ) documentId : UUID
@@ -61,6 +78,10 @@ class DocumentController(
61
78
return commentService.getComments(documentId).map { mapCommentToView(it) }
62
79
}
63
80
81
+ @ApiOperation(
82
+ value = " Reply to a given comment" ,
83
+ notes = " Reply to a given comment"
84
+ )
64
85
@PostMapping(" /{documentId}/comments/{commentId}" )
65
86
fun replyToComment (
66
87
@PathVariable(" documentId" ) documentId : UUID ,
@@ -79,6 +100,10 @@ class DocumentController(
79
100
)
80
101
}
81
102
103
+ @ApiOperation(
104
+ value = " Get a given comment" ,
105
+ notes = " Get a given comment"
106
+ )
82
107
@GetMapping(" /{documentId}/comments/{commentId}" )
83
108
fun getCommentWithPossibleThread (
84
109
@PathVariable(" documentId" ) documentId : UUID ,
0 commit comments