Skip to content

Commit

Permalink
[BE] ✨ feat : chat ws API 문서화 merge
Browse files Browse the repository at this point in the history
[BE] ✨ feat : chat ws API 문서화 #512
  • Loading branch information
hobeen-kim authored Oct 2, 2023
2 parents 66b5262 + 67d549f commit 779b804
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions Server/src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ include::overview.adoc[]

=== Chat API
* link:snippets/chat/userchat.html[사용자 채팅 API, onclick="window.location.href='snippets/chat/userchat.html'"]
* link:snippets/chat/chat.html[채팅 WS API, onclick="window.location.href='snippets/chat/chat.html'"]


74 changes: 74 additions & 0 deletions Server/src/docs/asciidoc/snippets/chat/chat.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 2
:sectlinks:
:docinfo: shared-head

[[Chat]]
= 채팅 WS API

= WebSocket API

== Connect
WebSocket endpoint 연결

`https://api.itprometheus.net/ws`.

== Subscribe
Subscribe 엔드포인트입니다. 아래 사항을 읽어주세요.

**1. 관리자는 미할당된 채팅방에 대해서 구독 가능**

- 미할당된 채팅방은 `GET : /admin/chats` 으로 조회 가능합니다.

**2. 일반 사용자는 자기 자신 email 만 구독 가능**

[source,text]
----
/sub/chat/room/[email protected]
----

|===
|필드명|설명
|`+room-id+`
|`+구독할 roomId+`
|===

== UnSubscribe
Subscribe 엔드포인트입니다. 채팅방 완료 처리 시 반드시 UnSubscribe 해주세요.

[source,text]
----
/sub/chat/room/[email protected]
----

== Message
Message 는 SEND 로 보내주세요.

=== Request Endpoints
[source,text]
----
/pub/message
----

=== Request Headers
|===
|헤더명|설명|필수여부
|`+Authorization+`
|Access Token
|필수
|===

=== Request Body
[source,options="nowrap"]
----
{
"roomId" : "[email protected]",
"message" : "this is message"
}
----



0 comments on commit 779b804

Please sign in to comment.