postman api์์ importํ๊ธฐ ์ด์, ์ถ๊ฐ โ ์งํ์๊ฒ
# ์์ ๋คํธ์ํฌ ํ๋ก์ ํธ React ํน์ Vue.js๋ฅผ ์ด์ฉํ์ฌ ์์ ๋คํธ์ํฌ ์๋น์ค๋ฅผ ๊ตฌํํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ธ ์๋ฒ API๋ ์ ๊ณต๋๋ฉฐ ๋์์ธ๊ณผ ์ํคํ ์ฒ๋ ์์ ๋กญ๊ฒ ์์ฑํฉ๋๋ค. ๋ฐ์ดํฐ ์ค ์ฑ๋์ ์๋ฒ์์ ์ ๊ณตํ๋ ๊ฒ๋ง ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ ๊ณต๋๋ ์ฑ๋์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. * React * Vue * JavaScript * ๋ง์ง * ์ง์์๋ต * ๊ฐ ํ ์ฑ๋ > ์๋ฒ API๋ ๋ชจ๋ ํ์ด ๊ณต์ฉ์ผ๋ก ์ฌ์ฉํฉ๋๋ค. ์์ฑํ ๋ฐ์ดํฐ๊ฐ ๋ค๋ฅธ ์ฌ์ฉ์์๊ฒ ๋ ธ์ถ๋ ์ ์์ผ๋ ์ฃผ์ํด์ฃผ์ธ์! ## ๊ธฐ๋ณธ ์๊ตฌ์ฌํญ **ํ์** - ์ฌ์ฉ์๋ ํ์๊ฐ์ ๊ณผ ๋ก๊ทธ์ธ์ ํ ์ ์์ต๋๋ค. - ๊ฐ์ , ๋ก๊ทธ์ธ, ์ธ์ฆ ๊ฒ์ฌ - ์ฌ์ฉ์๋ ์ฑ๋์ ์ฌ๋ผ์จ ๊ธ์ ๋ณผ ์ ์์ต๋๋ค. - ๊ธ์ฐ๊ธฐ, ์ฑ๋ ๋ชฉ๋ก, ์ฑ๋ ๋ด ๊ธ ๋ชฉ๋ก - ์ธ์ฆ๋ ์ฌ์ฉ์๋ ์ฑ๋์ ์ฌ๋ผ์จ ๊ธ์ ๋ณผ ์ ์์ต๋๋ค. - ์ธ์ฆ๋ ์ฌ์ฉ์๋ ์ฑ๋์ ํฌ์คํธ๋ฅผ ๋จ๊ธธ ์ ์์ต๋๋ค. - ์ธ์ฆ๋ ์ฌ์ฉ์๋ ํฌ์คํธ๋ฅผ ์ข์์ ํ ์ ์์ต๋๋ค. - ์ธ์ฆ๋ ์ฌ์ฉ์๋ ํฌ์คํธ์ ๋๊ธ์ ๋จ๊ธธ ์ ์์ต๋๋ค. - SPA ํํ๋ก ๋ง๋ค์ด์ฃผ์ธ์. - ์๋ฑํ ํ์ด์ง์ ์ ์ํ๋ฉด 404 ํ์ด์ง๋ฅผ ๋ณด์ฌ์ฃผ์ธ์. **์ ํ** * ์ฌ์ฉ์๋ ํ์ฌ ์ ์ ์ค์ธ ์ฌ์ฉ์๋ฅผ ๋ณผ ์ ์์ต๋๋ค. * ์ฌ์ฉ์๋ ๊ฐ์ ์ ๋ชฉ๋ก์ ๋ณผ ์ ์์ต๋๋ค. * ์ฌ์ฉ์๋ ๊ฐ์ ์๋ฅผ ์ด๋ฆ์ผ๋ก ๊ฒ์์ ํ ์ ์์ต๋๋ค. * ์ฌ์ฉ์๋ ๊ฐ์ ์์ ์ ๋ณด๋ฅผ ๋ณผ ์ ์์ต๋๋ค. * ์ฌ์ฉ์๋ ํฌ์คํธ ํน์ ๊ฐ์ ์๋ฅผ ๊ฒ์ํ ์ ์์ต๋๋ค. * ์ธ์ฆ๋ ์ฌ์ฉ์๋ ์์ ์ ์ ๋ณด๋ฅผ ๋ณ๊ฒฝํ ์ ์์ต๋๋ค. * ์ธ์ฆ๋ ์ฌ์ฉ์๋ ์์ ์ ์๋ฆผ ๋ชฉ๋ก์ ํ์ธ ํ ์ ์์ต๋๋ค. * ์ธ์ฆ๋ ์ฌ์ฉ์๋ ๋ค๋ฅธ ๊ฐ์ ์์๊ฒ ๋ฉ์์ง๋ฅผ ๋ณด๋ผ ์ ์์ต๋๋ค. * ์ธ์ฆ๋ ์ฌ์ฉ์๋ ์์ ์๊ฒ ์จ ๋ฉ์์ง ๋ชฉ๋ก์ ํ์ธ ํ ์ ์์ต๋๋ค. * ์ธ์ฆ๋ ์ฌ์ฉ์๋ ํน์ ์ฌ์ฉ์์์ ๋ฉ์์ง ๋ํ ๋ด์ญ์ ํ์ธ ํ ์ ์์ต๋๋ค. ## ๋ณด๋์ค ์๊ตฌ์ฌํญ * ์ธ์ฆ๋ ์ฌ์ฉ์๋ ํ๋กํ ์ด๋ฏธ์ง ๋ณ๊ฒฝ ๋ฐ ํฌ์คํธ๋ฅผ ์์ฑํ ๋ ์ด๋ฏธ์ง๋ฅผ ์ฒจ๋ถํ ์ ์์ต๋๋ค. ํ์ผ ์ ๋ก๋๋ฅผ ๊ตฌํํด๋ณด์ธ์. * ๋คํฌ ๋ชจ๋๋ฅผ ์ ์ฉํด๋ณด์ธ์. * WebSocket์ ์ด์ฉํ์ฌ ๋ค๋ฅธ ์ฌ์ฉ์์ ๋ฉ์์ง๋ฅผ ์ค์๊ฐ์ผ๋ก ๋ฐ์๋ณด์ธ์. * WebSocket์ ์ด์ฉํ์ฌ ์๋ฆผ์ ๋ฐ๊ณ ์๋ฆผ์ Context์ localStorage๋ก ๊ด๋ฆฌํด๋ณด์ธ์. ## API ์๋ด API Host๋ `http://13.209.30.200` ์ ๋๋ค. API ์ฌ์ฉ์ ๋ฌธ์ ๊ฐ ์๋ค๋ฉด ๋ฌธ์๋ฐ๋๋๋ค. * ์ฃผ์ํ ์ ์ผ๋ก API์ ์์ธ์ฒ๋ฆฌ๊ฐ ์๋์ด์๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. ์ด ๊ฒฝ์ฐ ํ๋ก ํธ์๋์์ Form Validation์ ํด์ฃผ์๋ฉด ๋ฉ๋๋ค. * ์๋ต์ด ๋ชจ๋ธ๋ก ๋์ด์๋ ๊ฒฝ์ฐ ํ๋จ ๋ชจ๋ธ ์๋ด๋ฅผ ํ์ธํด์ฃผ์ธ์. * Optional<Type>์ผ๋ก ์ ํ์๋ ๊ฒฝ์ฐ ๊ฐ์ ๋ฃ์ง ์์๋ ๋์ํ๋ ํ๋์ ๋๋ค. * Nullable<Type>์ผ๋ก ์ ํ์๋ ๊ฒฝ์ฐ null์ด ๋ด๋ ค์ฌ ์ ์๋ ํ๋์ ๋๋ค. * []๋ ๋ฆฌ์คํธ ํ์ ์ ๋๋ค. * API URL์ ์ค๊ดํธ๋ก ๊ฐ์ธ์ ธ ์๋ ๋ถ๋ถ์ Path Variable ์ ๋๋ค. ### ์ธ์ฆ #### ๋ก๊ทธ์ธ ์ฌ์ฉ์๊ฐ ์ด๋ฉ์ผ๊ณผ ๋น๋ฐ๋ฒํธ๋ก ์๋น์ค์ ๋ก๊ทธ์ธํฉ๋๋ค. > POST /login ##### Request Body ```json { "email": String, "password": String } ``` ##### Response 200 OK ```json { "user": User, "token": String } ``` #### ํ์๊ฐ์ ์ฌ์ฉ์๊ฐ ์ด๋ฉ์ผ๊ณผ ๋น๋ฐ๋ฒํธ๋ก ์๋น์ค์ ๊ฐ์ ํฉ๋๋ค. > POST /signup ##### Request Body ```json { "email": String, "fullName": String, "password": String } ``` ##### Response 200 OK ```json { "user": User, "token": String } ``` #### ๋ก๊ทธ์์ ์ฌ์ฉ์๊ฐ ๋ก๊ทธ์์ ํฉ๋๋ค. > POST /logout #### ์ธ์ฆ ํ์ธ ์ฌ์ฉ์๊ฐ ์ธ์ฆ์ด ๋์๋์ง ํ์ธํฉ๋๋ค. > GET /auth-user ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Response ``` User ``` ### ์ฌ์ฉ์ #### ์ฌ์ฉ์ ๋ชฉ๋ก ์ฌ์ฉ์ ๋ชฉ๋ก์ ๋ถ๋ฌ์ต๋๋ค. > GET /users/get-users ##### Request Params ``` offset: Optional<Number> limit: Optional<Number> ``` ##### Response ``` User[] ``` #### ํ์ฌ ์ ์ ์ค์ธ ์ฌ์ฉ์ ๋ชฉ๋ก ํ์ฌ ์ ์ ์ค์ธ ์ฌ์ฉ์ ๋ชฉ๋ก์ ๋ถ๋ฌ์ต๋๋ค. > GET /users/online-users ##### Response ``` User[] ``` #### ์ฌ์ฉ์ ์ ๋ณด ํน์ ์ฌ์ฉ์ ์ ๋ณด๋ฅผ ๋ถ๋ฌ์ต๋๋ค. > GET /users/{userId} ##### Response ``` User ``` #### ํ๋กํ ์ด๋ฏธ์ง ๋ณ๊ฒฝ ๋์ ํ๋กํ ์ด๋ฏธ์ง๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค. > POST /users/upload-photo ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body FormData `isCover`๋ฅผ ๋ฐ๋์ `false`๋ก ๋ฃ์ด์ผ ํฉ๋๋ค. ``` isCover: false image: Binary ``` ##### Response ``` User ``` #### ์ปค๋ฒ ์ด๋ฏธ์ง ๋ณ๊ฒฝ ๋์ ์ปค๋ฒ ์ด๋ฏธ์ง๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค. > POST /users/upload-photo ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body FormData `isCover`๋ฅผ ๋ฐ๋์ `true`๋ก ๋ฃ์ด์ผ ํฉ๋๋ค. ``` isCover: true image: Binary ``` ##### Response ``` User ``` ### ์ค์ #### ๋ด ์ ๋ณด ๋ณ๊ฒฝ ๋์ ์ ๋ณด๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค. > PUT /settings/update-user ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "fullName": String, "username": String } ``` ##### Response ``` User ``` #### ๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ ๋ด ๊ณ์ ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค. > PUT /settings/update-password ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "password": String } ``` ### ์ฑ๋ #### ์ฑ๋ ๋ชฉ๋ก ์ฑ๋ ๋ชฉ๋ก์ ๋ถ๋ฌ์ต๋๋ค. > GET /channels ##### Response ``` Channel[] ``` #### ์ฑ๋ ์ ๋ณด ํน์ ์ฑ๋ ์ ๋ณด๋ฅผ ๋ถ๋ฌ์ต๋๋ค. > GET /channels/{channelName} ##### Response ``` Channel ``` ### ํฌ์คํธ #### ํน์ ์ฑ๋์ ํฌ์คํธ ๋ชฉ๋ก ํน์ ์ฑ๋์ ํฌ์คํธ ๋ชฉ๋ก์ ๋ถ๋ฌ์ต๋๋ค. > GET /posts/channel/{channelId} ##### Request Params ```json offset: Optional<Number> limit: Optional<Number> ``` ##### Response ``` Post[] ``` #### ํน์ ์ฌ์ฉ์์ ํฌ์คํธ ๋ชฉ๋ก ํน์ ์ฌ์ฉ์์ ํฌ์คํธ ๋ชฉ๋ก์ ๋ถ๋ฌ์ต๋๋ค. > GET /posts/author/{authorId} ##### Request Params ```json offset: Optional<Number> limit: Optional<Number> ``` ##### Response ``` Post[] ``` #### ํน์ ์ฑ๋์ ํฌ์คํธ ์์ฑํ๊ธฐ ํน์ ์ฑ๋์ ํฌ์คํธ๋ฅผ ์์ฑํฉ๋๋ค. > POST /posts/create ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body FormData ``` title: String, image: Binary | null, channelId: String ``` #### ํน์ ํฌ์คํธ ์์ธ ๋ณด๊ธฐ ํน์ ํฌ์คํธ์ ์ ๋ณด๋ฅผ ๋ถ๋ฌ์ต๋๋ค. > POST /posts/{postId} ##### Response ``` Post ``` #### ๋ด๊ฐ ์์ฑํ ํฌ์คํธ ์์ ํ๊ธฐ ๋ด๊ฐ ์์ฑํ ํฌ์คํธ๋ฅผ ์์ ํฉ๋๋ค. > PUT /posts/update ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body FormData ์ด๋ฏธ์ง๋ฅผ ์ญ์ ํ๋ ค๋ฉด `imageToDeletePublicId`์ `imagePublicId`๋ฅผ ๋ฃ์ด์ฃผ์ธ์. ``` postId: String title: String image: Binary | null imageToDeletePublicId: Optional<String> channelId: String ``` #### ๋ด๊ฐ ์์ฑํ ํฌ์คํธ ์ญ์ ํ๊ธฐ ๋ด๊ฐ ์์ฑํ ํฌ์คํธ๋ฅผ ์ญ์ ํฉ๋๋ค. > DELETE /posts/delete ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "id": String } ``` ### ์ข์์ #### ํน์ ํฌ์คํธ ์ข์์ ํน์ ํฌ์คํธ์ ์ข์์ํฉ๋๋ค. > POST /likes/create ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "postId": String } ``` ##### Response ``` Like ``` #### ํน์ ํฌ์คํธ ์ข์์ ์ทจ์ ํน์ ํฌ์คํธ์ ์ข์์ํ ๊ฒ์ ์ทจ์ํฉ๋๋ค. > DELETE /likes/delete ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "id": String } ``` ##### Response ``` Like ``` ### ๋๊ธ #### ํน์ ํฌ์คํธ์ ๋๊ธ ๋ฌ๊ธฐ ํน์ ํฌ์คํธ์ ๋๊ธ์ ์์ฑํฉ๋๋ค. > POST /comments/create ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "comment": String, "postId": String } ``` ##### Response ``` Comment ``` #### ํน์ ํฌ์คํธ์ ์์ฑํ ๋ด ๋๊ธ ์ง์ฐ๊ธฐ ํน์ ํฌ์คํธ์ ์์ฑํ ๋ด ๋๊ธ์ ์ญ์ ํฉ๋๋ค. > DELETE /comments/delete ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "id": String } ``` ##### Response ``` Comment ``` ### ์๋ฆผ #### ๋์ ์๋ฆผ ๋ชฉ๋ก ๋์ ์๋ฆผ ๋ชฉ๋ก์ ๋ถ๋ฌ์ต๋๋ค. > GET /notifications ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Response ``` Notification[] ``` #### ์๋ฆผ ํ์ธ ์ฒ๋ฆฌ ๋์๊ฒ ์จ ์๋ฆผ์ ์ฝ์์ฒ๋ฆฌ ํฉ๋๋ค. > GET /notifications/seen ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` #### ์๋ฆผ ์์ฑ ์๋๋ฐฉ์๊ฒ ์๋ฆผ์ ๋ณด๋ ๋๋ค. > POST /notifications/create ์๋๋ ์๋ฒ์์ ํด์ฃผ๋๊ฒ ๋ง๋ ์์ ์ด์ง๋ง API ํธ์ถ๋ก ์๋ฆผ์ ๋ณด๋ผ ์ ์๋๋ก ์์ฑํ์ต๋๋ค. ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body `notificationTypeId`๋ type์ ํด๋นํ๋ ๊ฐ์ฒด์ id๋ฅผ ๋ฃ์ด์ฃผ์ธ์. * COMMENT์ผ ๊ฒฝ์ฐ์ ๋๊ธ id * FOLLOW์ผ ๊ฒฝ์ฐ์ ํ๋ก์ฐ id * LIKE์ผ ๊ฒฝ์ฐ์ ์ข์์ id * MESSAGE์ผ ๊ฒฝ์ฐ์ ๋ฉ์์ง id `postId`๋ type์ด FOLLOW์ผ ๊ฒฝ์ฐ์ null๋ก ๋ณด๋ด์ฃผ์ธ์. ```json { "notificationType": "COMMENT" | "FOLLOW" | "LIKE" | "MESSAGE", "notificationTypeId": String, "userId": String, "postId": Nullable<String> } ``` ##### Response ``` Notification ``` ### ํ๋ก์ฐ #### ํน์ ์ ์ ํ๋ก์ฐ ํน์ ์ ์ ๋ฅผ ํ๋ก์ฐํฉ๋๋ค. > POST /follow/create ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "userId": String } ``` ##### Response ``` Follow ``` #### ํน์ ์ ์ ์ธํ ํน์ ์ ์ ๋ฅผ ์ธํํฉ๋๋ค. > DELETE /follow/delete ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "id": String } ``` ##### Response ``` Follow ``` ### ๋ฉ์์ง #### ๋์ ๋ฉ์์งํจ (์ํตํ ์ ์ ๋ชฉ๋ก) ๋์ ๋ฉ์์งํจ์ ๋ถ๋ฌ์ต๋๋ค. > GET /messages/conversations ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Response ```json Conversation[] ``` #### ํน์ ์ฌ์ฉ์์ ์ํตํ ๋ฉ์์ง ๋ชฉ๋ก ํน์ ์ฌ์ฉ์์ ์ํตํ ๋ฉ์์ง ๋ชฉ๋ก์ ๋ถ๋ฌ์ต๋๋ค. > GET /messages ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Params ``` userId: String ``` ##### Response ``` Message[] ``` #### ํน์ ์ฌ์ฉ์์๊ฒ ๋ฉ์์ง ์ ์ก ํน์ ์ฌ์ฉ์์๊ฒ ๋ฉ์์ง๋ฅผ ์ ์กํฉ๋๋ค. > POST /messages/create ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "message": String, "receiver": String // ์ฌ์ฉ์ id } ``` ##### Response ``` Message ``` #### ๋ฉ์์ง ํ์ธ ์ฒ๋ฆฌ ํน์ ์ฌ์ฉ์์ ๋๋ ๋ฉ์์ง๋ฅผ ์ฝ์์ฒ๋ฆฌ ํฉ๋๋ค. > PUT /messages/update-seen ##### Request Header ``` Authorization: bearer JWTํ ํฐ ``` ##### Request Body ```json { "sender": String // ์ฌ์ฉ์ id } ``` ## ๊ฒ์ #### ์ฌ์ฉ์ ๊ฒ์ ์ฌ์ฉ์๋ฅผ ๊ฒ์ํฉ๋๋ค. > GET /search/users/{query} ##### Response ``` User[] ``` #### ์ ์ฒด ๊ฒ์ (ํฌ์คํธ, ์ฌ์ฉ์) ํฌ์คํธ์ ์ฌ์ฉ์๋ฅผ ๊ฒ์ํฉ๋๋ค. > GET /search/all/{query} ##### Response ``` (User | Post)[] ``` ## WebSocket ์๋ด ### on ํด๋ผ์ด์ธํธ๊ฐ ์๋ฒ์๊ฒ ๋ฐ์ดํฐ๋ฅผ ๋ฐ์ต๋๋ค. #### SEND_MESSAGE ์ค์๊ฐ์ผ๋ก ๋ฉ์์ง๋ฅผ ๋ฐ์ต๋๋ค. ``` Message[] ``` #### CREATE_NOTIFICATION_REQUEST ์ค์๊ฐ์ผ๋ก ์์ฑ๋ ์๋ฆผ์ ๋ฐ์ต๋๋ค. ``` Notification[] ``` ### emit ํด๋ผ์ด์ธํธ๊ฐ ์๋ฒ์๊ฒ ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ ๋๋ค. #### CREATE_MESSAGE ``` Message ``` #### CREATE_NOTIFICATION ``` Notification ``` ## ๋ชจ๋ธ ์๋ด API์ ๋ฐ๋ผ ๋ชจ๋ธ ํ๋์์ ์ผ๋ถ๋ถ์ด ๋น ์ง ์ํ๋ก ๋ด๋ ค์ฌ ์ ์์ต๋๋ค. `ex) ๋ก๊ทธ์ธ ํ ๋ด๋ ค์ค๋ User์๋ ํ๋กํ ์ด๋ฏธ์ง์ ์ปค๋ฒ ์ด๋ฏธ์ง ํ๋๊ฐ ์ ๊ฑฐ๋ฉ๋๋ค.` ### User ```json { "coverImage": String, // ์ปค๋ฒ ์ด๋ฏธ์ง "image": String, // ํ๋กํ ์ด๋ฏธ์ง "role": String, "emailVerified": Boolean, // ์ฌ์ฉ๋์ง ์์ "banned": Boolean, // ์ฌ์ฉ๋์ง ์์ "isOnline": Boolean, "posts": Post[], "likes": Like[], "comments": String[], "followers": [], "following": [ { "_id": "6169e91316cb2265df003c6d", "user": "6169e58216cb2265df003bf4", "follower": "6169e206aa57d952c6dc1edd", "createdAt": "2021-10-15T20:48:19.816Z", "updatedAt": "2021-10-15T20:48:19.816Z", "__v": 0 } ], "notifications": Notification[], "messages": Message[], "_id": String, "fullName": String, "email": String, "createdAt": String, "updatedAt": String } ``` ### Channel ```json { "authRequired": Boolean, // ์ฌ์ฉ๋์ง ์์ "posts": String[], "_id": String, "name": String, "description": String, "createdAt": String, "updatedAt": String } ``` ### Post ```json { "likes": Like[], "comments": Comment[], "_id": String, "image": Optional<String>, "imagePublicId": Optional<String>, "title": String, "channel": Channel, "author": User, "createdAt": String, "updatedAt": String } ``` ### Like ```json { "_id": String, "user": String, // ์ฌ์ฉ์ id "post": String, // ํฌ์คํธ id "createdAt": String, "updatedAt": String } ``` ### Comment ```json { "_id": String, "comment": String, "author": User, "post": String, // ํฌ์คํธ id "createdAt": String, "updatedAt": String } ``` ### Notification ```json { "seen": Boolean, "_id": String, "author": User, "user": User | String, "post": Nullable<String>, // ํฌ์คํธ id "follow": Optional<String>, // ์ฌ์ฉ์ id "comment": Optional<Comment>, "message": Optional<String>, // ๋ฉ์์ง id "createdAt": String, "updatedAt": String } ``` ### Follow ```json { "_id": String, "user": String, // ์ฌ์ฉ์ id "follower": String, // ์ฌ์ฉ์ id "createdAt": String, "updatedAt": String } ``` ### Conversation ```json { "_id": String[], "message": String, "sender": User, "receiver": User, "seen": Boolean, "createdAt": String } ``` ### Message ```json { "_id": String, "message": String, "sender": User, "receiver": User, "seen": Boolean, "createdAt": String, "updatedAt": String } ```