Skip to content

Commit

Permalink
docs: 채팅 api 문서화
Browse files Browse the repository at this point in the history
  • Loading branch information
jzakka committed Feb 17, 2024
1 parent dcc2674 commit 6030ce8
Show file tree
Hide file tree
Showing 12 changed files with 1,881 additions and 74 deletions.
17 changes: 17 additions & 0 deletions src/docs/asciidoc/EnterChatRoom.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
== Enter chat room

operation::chat-controller-test/Enter chat room[snippets="http-request,http-response,path-parameters"]

API server works with sse emitter.
You should use EventSource to make the request.

.Client Code Example
[source,javascript]
----
const sse = new EventSource('http://localhost:8080/chatRoom/22', {withCredentials: true});
sse.addEventListener('ChatMessage', (e) => {
const { data: receivedConnectData } = e;
console.log('message: ', receivedConnectData);
});
----
2 changes: 2 additions & 0 deletions src/docs/asciidoc/LoadMoreChats.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Load more chats
operation::chat-controller-test/Load more chats[snippets="http-request,http-response,path-parameters,query-parameters"]
2 changes: 2 additions & 0 deletions src/docs/asciidoc/SendChatMessage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== Send chat message
operation::chat-controller-test/Send chat message[snippets="http-request,http-response,path-parameters"]
5 changes: 3 additions & 2 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ include::SetStatusOnline.adoc[]
include::SetStatusOffline.adoc[]
include::SearchOnlineMembers.adoc[]
include::CreateChatRoom.adoc[]
include::GetChatRoomAuthorization.adoc[]

include::EnterChatRoom.adoc[]
include::LoadMoreChats.adoc[]
include::SendChatMessage.adoc[]
44 changes: 22 additions & 22 deletions src/main/resources/static/docs/CreateADiary.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,24 @@ <h3 id="_create_a_diary_http_response">HTTP response</h3>
"title" : "My Stoury",
"thumbnailPath" : "/feed/images/image_1.jpeg",
"feeds" : {
"1" : [ {
"feedId" : 1,
"writer" : {
"id" : 1,
"username" : "writer1"
},
"graphicContentsPaths" : [ "/feed/images/image_1.jpeg" ],
"textContent" : "This is feed1",
"latitude" : 40.0627,
"lonitude" : -105.1779,
"tagNames" : [ "America", "denver" ],
"location" : {
"city" : "Colorado",
"country" : "United States"
},
"likes" : 20,
"createdAt" : "2024-02-17T20:43:47.162944"
} ],
"2" : [ {
"feedId" : 2,
"writer" : {
Expand All @@ -490,7 +508,7 @@ <h3 id="_create_a_diary_http_response">HTTP response</h3>
"country" : "United States"
},
"likes" : 13,
"createdAt" : "2024-02-17T15:31:07.264682"
"createdAt" : "2024-02-18T20:43:47.166407"
}, {
"feedId" : 3,
"writer" : {
Expand All @@ -507,29 +525,11 @@ <h3 id="_create_a_diary_http_response">HTTP response</h3>
"country" : "United States"
},
"likes" : 52,
"createdAt" : "2024-02-18T15:31:07.265345"
} ],
"1" : [ {
"feedId" : 1,
"writer" : {
"id" : 1,
"username" : "writer1"
},
"graphicContentsPaths" : [ "/feed/images/image_1.jpeg" ],
"textContent" : "This is feed1",
"latitude" : 40.0627,
"lonitude" : -105.1779,
"tagNames" : [ "America", "denver" ],
"location" : {
"city" : "Colorado",
"country" : "United States"
},
"likes" : 20,
"createdAt" : "2024-02-16T15:31:07.260551"
"createdAt" : "2024-02-19T20:43:47.166971"
} ]
},
"startDate" : "2024-02-16",
"endDate" : "2024-02-18",
"startDate" : "2024-02-17",
"endDate" : "2024-02-19",
"city" : "Colorado",
"country" : "United States",
"likes" : 85
Expand Down
511 changes: 511 additions & 0 deletions src/main/resources/static/docs/EnterChatRoom.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/main/resources/static/docs/GetChildComments.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ <h3 id="_get_child_comments_http_response">HTTP response</h3>
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 602
Content-Length: 601

[ {
"id" : 11,
Expand All @@ -468,7 +468,7 @@ <h3 id="_get_child_comments_http_response">HTTP response</h3>
},
"parentCommentId" : 1,
"textContent" : "First child comment",
"createdAt" : "2024-02-16T15:31:07.235701"
"createdAt" : "2024-02-17T20:43:47.138744"
}, {
"id" : 12,
"writerResponse" : {
Expand All @@ -477,7 +477,7 @@ <h3 id="_get_child_comments_http_response">HTTP response</h3>
},
"parentCommentId" : 1,
"textContent" : "Second child comment",
"createdAt" : "2024-02-16T15:31:07.236607"
"createdAt" : "2024-02-17T20:43:47.13935"
}, {
"id" : 13,
"writerResponse" : {
Expand All @@ -486,7 +486,7 @@ <h3 id="_get_child_comments_http_response">HTTP response</h3>
},
"parentCommentId" : 1,
"textContent" : "This comment was deleted",
"createdAt" : "2024-02-16T15:31:07.236968"
"createdAt" : "2024-02-17T20:43:47.139618"
} ]</code></pre>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/static/docs/GetComments.html
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ <h3 id="_get_comments_http_response">HTTP response</h3>
"feedId" : 1,
"hasNestedComments" : false,
"textContent" : "First comment",
"createdAt" : "2024-02-16T15:31:07.212193"
"createdAt" : "2024-02-17T20:43:47.124412"
}, {
"id" : 2,
"writer" : {
Expand All @@ -479,7 +479,7 @@ <h3 id="_get_comments_http_response">HTTP response</h3>
"feedId" : 1,
"hasNestedComments" : true,
"textContent" : "This comment was deleted",
"createdAt" : "2024-02-16T15:31:07.214048"
"createdAt" : "2024-02-17T20:43:47.126193"
}, {
"id" : 3,
"writer" : {
Expand All @@ -489,7 +489,7 @@ <h3 id="_get_comments_http_response">HTTP response</h3>
"feedId" : 1,
"hasNestedComments" : true,
"textContent" : "Third comment",
"createdAt" : "2024-02-16T15:31:07.214321"
"createdAt" : "2024-02-17T20:43:47.126462"
} ]</code></pre>
</div>
</div>
Expand Down
Loading

0 comments on commit 6030ce8

Please sign in to comment.