ํด๋ฌ์น ์๋น์ค์ ์ดํ๋ฆฌ์ผ์ด์ ์๋ฒ์ด๋ค.
์๋ฒ ์ธ์ด๋ก๋ Node.js๋ฅผ ์ฌ์ฉํ๋ฉฐ, ExpressJs ๋ฐ ejs๋ฅผ ์ฌ์ฉํ์ฌ API์ ์น ๋ฐฑ์๋๋ฅผ ๊ตฌ์ถํ๋ค. ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ง์ผ๋ก๋ MongoDB, ๋๋ผ์ด๋ฒ๋ก๋ mongoose๋ฅผ ์ฌ์ฉํ๋ค.
ํด๋ผ์ด์ธํธ๋จ์์ ์๋ฒ๋ก์ ๋ชจ๋ ํธ์ถ์ ๋น๋๊ธฐ์์ผ๋ก ์ด๋ฃจ์ด์ง๋ฉฐ(Asynchronize), ์๋ฒ๋ ๊ทธ ์์ฒญ์ ์ฒ๋ฆฌํด JSON ํํ์ ๊ฒฐ๊ณผ๊ฐ์ HTTP ์๋ต ํํ(application/json)๋ก ๋ฐํํ๋ค.
์๋ฒ์์ ๊ฐ๊ฐ์ REST ๋ฉ์๋์ ํด๋ผ์ด์ธํธ์ ์ธํฐํ์ด์ค ๋ฉ์๋๋ ์๋ก ๋์๋๋ค.
Main URL : http://dev.thedeblur.com:1129
์๋น์ค ์คํ ์ ๊น์ง ์์๋ก Deblur์ ๊ฐ๋ฐ์๋ฒ๋ฅผ ์ฌ์ฉํ๋ค.
๋ค์๊ณผ ๊ฐ์ ๋ช
๋ น์ด๋ค์ด ์กด์ฌํ๋ค.
GET : ํด๋น ๋ฆฌ์์ค๋ฅผ ๊ฐ์ ธ์ค๊ฑฐ๋, ๋ฆฌ์คํ
ํ๋ค.
POST : ํด๋น ๋ฆฌ์์ค๋ฅผ ์์ฑํ๋ค.
PATCH : ํด๋น ๋ฆฌ์์ค๋ฅผ ์์ ํ๋ค.
PATCH : ํด๋น ๋ฆฌ์์ค๋ฅผ ์์ ํ๋ค.
PUT : ํด๋น ๋ฆฌ์์ค์ ํ์ผ์ ์
๋ก๋ํ๋ค.
ํค๋๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๋ ์ ๊ทผ์ด ์ ํ๋ ๋ฆฌ์์ค๋ฅผ ์ธ์ฆํ ๋(token) ๋นผ๊ณ ๋ ์์ผ๋ฉฐ, ๋๋ถ๋ถ์ ํ๋ผ๋ฏธํฐ๋ GET์์๋ Query(x=1&y=2)๋ก, POST, PATCH, DELETE์์๋ FormUrlEncoded๋ก ์ ๋ฌ๋๋ค.
Response์ ํ์
์ ๋ฌด์กฐ๊ฑด application/json์ด๋ฉฐ, API ํธ์ถ ๊ฒฐ๊ณผ์ธ status๋ผ๋ ํญ๋ชฉ์ ํฌํจํ๋ค.
{
"status" : {
"code" : "200",
"message" : "์ฑ๊ณต"
},
"key" : โvalue",
"key" : โvalueโ,
(....)
}
| Code | Status | Message |
|---|---|---|
| 200 | SUCCEED | ์ฑ๊ณต |
| 400 | FAILED | ์คํจ (์๋ฒ ๋ด๋ถ ์ค๋ฅ) |
| 411 | FAILED_LESS_PARAMETER | ํ๋ผ๋ฏธํฐ ๋ถ์กฑ |
| 1000 | FAILED_DB_CONNECTION | ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ด๋ถ ์ค๋ฅ |
| 401 | FAILED_NO_PERMISSION | ๊ถํ ๋ถ์กฑ |
| 402 | FAILED_TOKEN_INVALID | Auth ํ ํฐ ๋ถ์ผ์น |
| 1001 | FAILED_ACCOUNT_INVALID | ๊ณ์ ๋ถ์ผ์น |
| 1002 | FAILED_ALREADY_EXISTS | ์์ด๋๊ฐ ์ด๋ฏธ ์กด์ฌ |
์ด ์ฝ๋๋ค์ ํด๋ผ์ด์ธํธ์ Clutch.Status ํด๋์ค์ ์๋ฒ์ status.json์ ๋ชจ๋ ์ ์๋์ด ์๋ค.
###METADATA STORE
PUT/picturesGET/pictures/full/:metadataIdGET/pictures/thumb/:metadataIdGET/pictures/custom/:metadataId/:width/:height
###USER
POST/user/registerPOST/user/loginGET/user/:idGET/user/:id/picturePOST/user/:id/pictureGET/user/:id/starPOST/user/:id/starGET/user/:id/followersGET/user/:id/followingsPOST/user/:id/followingsDELETE/user/:id/followingsPATCH/user/:idPATCH/user/:id/starDELETE/user/:id
###Clutch
GET/clutchPOST/clutchDELETE/clutch/:idPOST/clutch/:id/likeGET/clutch/:id/commentsPOST/clutch/:id/commentsDELETE/clutch/:id/comments/:commentId
###Clutch Book
GET/user/:id/cbPOST/user/:id/cbGET/user/:id/cb/:cbIdPUT/user/:id/cb/:cbIdDELETE/user/:id/cb/:cbIdGET/user/:id/cb/:cbId/followersGET/user/:id/cb/:cbId/followingsPOST/user/:id/cb/:cbId/followings
###Community
GET/communityPOST/community/:articleId/PUT/community/:articleId/DELETE/community/:articleId/POST/community/:articleId/likeGET/community/:articleId/GET/community/:articleId/commentsPOST/community/:articleId/commentsDELETE/community/:articleId/comments/:commentId
###Artist
GET/artist/:artistId/
###Notification
GET/notifications/meGET/notifications/friends
###Ranking
GET/ranking/GET/ranking/:date/details
###Settings
GET/user/:id/settings/:keyPOST/user/:id/settings/:key
์ ์ ์ ๊ฐ์ธ์ ์ธ ์ ๋ณด์ ์ ๊ทผํ๊ณ ์์ ํ๊ธฐ ์ํด์ ์ธ์ฆ์ด ํ์ํ๋ฐ, ์ด๋ ํ ํฐ์ด ํ์ํ๋ค.
์ ์ ์ ๊ณต๊ฐ์ ์ธ ์ ๋ณด(ํ๋กํ)์ ์ ๊ทผํ๊ธฐ ์ํด์๋ ์ ์ ์ ๊ณ ์ ๋ฒํธ์ธ User ID๋ฅผ ์์์ผ ํ๋ค.
ํ ํฐ์ HTTP Request์ Header์ token์ด๋ ํ๋์ ๋ค์ด๊ฐ๋ฉฐ, userId๋ URL ์์ฒด์ ๊ฒฝ๋ก๋ก ๋ค์ด๊ฐ๋ค.
๊ทธ๋ฌ๋ฏ๋ก ํ ํฐ๊ณผ ์ ์ ID๋ ๋ก๊ทธ์์ ์ ๊น์ง ํด๋ผ์ด์ธํธ์ ์ ์ฅ์์ ์์๋ก ์ ์ฅํด์ผ ํ๋ค.
========
์ ์ ๊ฐ Clutch ์๋น์ค์ ํ์๊ฐ์
ํ ๋ ์ฌ์ฉ๋ฉ๋๋ค.
picture ํ๋๋ฅผ ์ฑ์ธ๋ ๋จผ์ ๋ฉํ๋ฐ์ดํฐ ์คํ ์ด์ ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ ํ ๋ค Metadata ID๋ฅผ ์ฃผ๋ฉด ๋ฉ๋๋ค.
| Name | Type | Description |
|---|---|---|
| String | ์ด๋ฉ์ผ ์ฃผ์ | |
| pw | String | ํจ์ค์๋ (MD5 ํด์ฑ ํ์!) |
| name | String | ์ ์ ํ๋กํ์ ์ํ ๋ฉ์ธ์ง |
| status_message | String | ์ ์ ํ๋กํ์ ์ํ ๋ฉ์ธ์ง |
| picture | String | ์ ์ ์ ํ๋กํ ์ฌ์ง (Metadata ID) |
| gender | Number | ์ฑ๋ณ (๋จ์=0, ์ฌ์=1) |
| Name | Description |
|---|---|
| userToken | ์ ์ ์ ํ ํฐ. ๊ฐ์ธ์ ๋ณด ์ ๊ทผ์ ์ธ์ฆ์ ์ฌ์ฉ๋๋ค. |
| userId | ์ ์ ์ ๊ณ ์ ๋ฒํธ. ๊ณต๊ฐ์ ์ธ ์ ๋ณด ์ ๊ทผ์ ์ฌ์ฉ๋จ. |
| Code | Status | Message |
|---|---|---|
| 200 | SUCCESS | ์ฑ๊ณต |
| 1002 | REGISTER_ACOUNT_EXISTS | ์ด๋ฉ์ผ ์ค๋ณต |
POST /user/register
email=test@clutch.com
pw=5d41402abc4b2a76b9719d911017c592 // MD5("hello")
status_message=Hello
picture=(none)
gender=0
>>>>>>>>>>
{
status: { code: 200, message: "์ฑ๊ณต" },
userId: (User ID),
userToken: (user Token)
}
========
์ ์ ๊ฐ Clutch ์๋น์ค์ ๋ก๊ทธ์ธํ ๋ ์ฌ์ฉ๋ฉ๋๋ค.
| Name | Type | Description |
|---|---|---|
| String | ์ด๋ฉ์ผ ์ฃผ์ | |
| pw | String | ํจ์ค์๋ (MD5 ํด์ฑ ํ์!) |
| Name | Description |
|---|---|
| userToken | ์ ์ ์ ํ ํฐ. ๊ฐ์ธ์ ๋ณด ์ ๊ทผ์ ์ธ์ฆ์ ์ฌ์ฉ๋๋ค. |
| userId | ์ ์ ์ ๊ณ ์ ๋ฒํธ. ๊ณต๊ฐ์ ์ธ ์ ๋ณด ์ ๊ทผ์ ์ฌ์ฉ๋จ. |
| Code | Status | Message |
|---|---|---|
| 200 | SUCCESS | ์ฑ๊ณต |
| 1001 | LOGIN_FAILED_ACCOUNT_MISMATCH | ๊ณ์ ๋ถ์ผ์น |
POST /user/login email=test@clutch.com pw=5d41402abc4b2a76b9719d911017c592 // MD5("hello") >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, userId: (User ID), userToken: (user Token) }
========
ํ ์ ์ ์ ํ๋กํ์ ์ป์ด์ฌ ๋ ์ฌ์ฉ๋๋ค.
| Name | Type | Description |
|---|---|---|
| id | String | ์ํ๋ ์ ์ ์ ID |
| Name | Description |
|---|---|
| profile | ์ ์ ์ ํ๋กํ (JSON ๊ฐ์ฒด) |
| profile.name | ์ด๋ฆ |
| profile.status_message | ์ ์ ํ๋กํ์ ์ํ ๋ฉ์ธ์ง |
| profile.picture | ์ ์ ์ ํ๋กํ ์ฌ์ง (Metadata ID) |
| profile.followers_count | ํ๋ก์๋ค์ ์ |
| profile.followings_count | ํ๋ก์ํ๋ ์ |
| profile.gender | ์ฑ๋ณ (๋จ์=0, ์ฌ์=1) |
| profile.last_photos | ์ ์ ์ ๋ํ ์ฌ์ง 5๊ฐ (Metadata ID) |
GET /user/52ff32f5ce6c300f55000003 >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, profile: { name: "๊น๋ฃ์ค", status_message: "์๋ฝ์๋ฝ~", picture: "(no pic)", followers_count: 3, followings_count: 0, gender: 0, last_photos: [] } }
========
ํ ์ ์ ์ ํ๋กํ ์ฌ์ง์ ์ป์ด์ฌ ๋ ์ฌ์ฉ๋๋ค.
| Name | Type | Description |
|---|---|---|
| id | String | ์ํ๋ ์ ์ ์ ID |
| x | Number | (์ต์ ) ์ํ๋ ์ฌ์ง์ ๊ฐ๋กํฌ๊ธฐ |
| y | Number | (์ต์ ) ์ํ๋ ์ฌ์ง์ ์ธ๋กํฌ๊ธฐ |
Content-Type: image/jpeg
Body: (ํ๋กํ ์ฌ์ง)
GET /user/52ff32f5ce6c300f55000003/picture?x=300&y=300 >>>>>>>>>> Content-Type: image/jpeg Body: (ํ๋กํ ์ฌ์ง)
========
ํ ์ ์ ์ ํ๋กํ ์ฌ์ง์ ๋ฐ๊ฟ ๋ ์ฌ์ฉ๋๋ค.
| Name | Description |
|---|---|
| token | ์ ์ ์ ํ ํฐ |
| Name | Type | Description |
|---|---|---|
| id | String | ์ํ๋ ์ ์ ์ ID |
| picture | (multipart) File | ํ๋กํ ์ด๋ฏธ์ง ํ์ผ |
PUT /user/52ff32f5ce6c300f55000003/picture >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }}
========
| Name | Type | Description |
|---|---|---|
| id | String | ์ํ๋ ์ ์ ์ ID |
| Name | Description |
|---|---|
| star | ํ์ ๊ฐฏ์ |
GET /user/52ff32f5ce6c300f55000003/star >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, stars: 0 }
========
| Name | Description |
|---|---|
| token | ์ ์ ์ ํ ํฐ |
| Name | Type | Description |
|---|---|---|
| id | String | ์ํ๋ ์ ์ ์ ID |
| count | Number | ์ฃผ๊ธฐ๋ฅผ ์ํ๋ ํ์ ๊ฐฏ์ |
POST /user/52ff32f5ce6c300f55000003/star >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
์ ์ ์ ํ๋ก์ด ๋ชฉ๋ก์ ๊ตฌํ๋ค. ๋ฆฌ์คํธ ํ์์ผ๋ก Responseํ๋ค.
| Name | Type | Description |
|---|---|---|
| id | String | ์ํ๋ ์ ์ ์ ID |
| pageNo | Number | ๋ช๋ฒ์งธ ํ์ด์ง์ ๊ฒฐ๊ณผ๋ฅผ ์ํ๋๊ฐ |
| pageCount | Number | ํํ์ด์ง์ ๋ช๊ฐ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฃ๋๊ฐ |
| Name | Description |
|---|---|
| followers | ํ๋ก์ด ๋ฐฐ์ด |
| followers.id | ํ๋ก์ด ID |
| followers.name | ํ๋ก์ด ์ด๋ฆ |
| followers.status_message | ํ๋ก์ด ์ํ ๋ฉ์ธ์ง |
| followers.picture | ํ๋ก์ด ํ๋กํ ์ฌ์ง ID |
| followers.followers_count | ํ๋ก์ด์ ํ๋ก์ด ๋ช ์ |
| followers.followings_count | ํ๋ก์ด์ ํ๋ก์ ๋ช ์ |
| followers.gender | ํ๋ก์ด์ ํ๋ก์ ๋ช ์ |
| followers.last_photos[] | ํ๋ก์ด์ ๋ํ ์ฌ์ง 5์ฅ |
GET /user/52ff32f5ce6c300f55000003/followers?pageNo=0&pageCount=50 >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, followers: [ { id: 52ff32f5ce6c300f55000014, name: "๊น์ ์ ", status_message: "์ ์ 1์ ๋๋ค. ์๋ฝ~", picture: (no pic), followers_count: 0, followings_count: 1, gender: 1, last_photos: [a,b,c,d,e] }, { id: 6a6831f4ce6c300f55000025, name: "๋ฐ์ ์ ", status_message: "์ ์ 2์ ๋๋ค. ์๋ฝ~", picture: (no pic), followers_count: 51, followings_count: 1, gender: 0, last_photos: [b,C,a,D,x] } ] }
========
| Name | Type | Description |
|---|---|---|
| id | String | ์ํ๋ ์ ์ ์ ID |
| pageNo | Number | ๋ช๋ฒ์งธ ํ์ด์ง์ ๊ฒฐ๊ณผ๋ฅผ ์ํ๋๊ฐ |
| pageCount | Number | ํํ์ด์ง์ ๋ช๊ฐ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฃ๋๊ฐ |
| Name | Description |
|---|---|
| followings | ํ๋ก์ ๋ฐฐ์ด |
| followings.id | ํ๋ก์์ ID |
| followings.name | ํ๋ก์ ์ด๋ฆ |
| followings.status_message | ํ๋ก์์ ์ํ ๋ฉ์ธ์ง |
| followings.picture | ํ๋ก์์ ํ๋กํ ์ฌ์ง ID |
| followings.followers_count | ํ๋ก์์ ํ๋ก์ด ๋ช ์ |
| followings.followings_count | ํ๋ก์์ ํ๋ก์ ๋ช ์ |
| followings.gender | ํ๋ก์์ ํ๋ก์ ๋ช ์ |
| followings.last_photos[] | ํ๋ก์์ ๋ํ ์ฌ์ง 5์ฅ |
GET /user/52ff32f5ce6c300f55000003/followings?pageNo=0&pageCount=50 >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, followings: [ { id: 52ff32f5ce6c300f55000014, name: "๊น์ ์ ", status_message: "์ ์ 1์ ๋๋ค. ์๋ฝ~", picture: (no pic), followers_count: 0, followings_count: 1, gender: 1, last_photos: [a,b,c,d,e] }, { id: 6a6831f4ce6c300f55000025, name: "๋ฐ์ ์ ", status_message: "์ ์ 2์ ๋๋ค. ์๋ฝ~", picture: (no pic), followers_count: 51, followings_count: 1, gender: 0, last_photos: [b,C,a,D,x] } ] }
========
| Name | Description |
|---|---|
| token | ์ ์ ์ ํ ํฐ |
| Name | Type | Description |
|---|---|---|
| id | String | ์ ์ ์ ID |
| following_id | String | ํ๋ก์ฐ๋ฅผ ์ํ๋ ์ ์ ์ ID |
POST /user/52ff32f5ce6c300f55000003/followings >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
| Name | Description |
|---|---|
| token | ์ ์ ์ ํ ํฐ |
| Name | Type | Description |
|---|---|---|
| id | String | ์ ์ ์ ID |
| following_id | String | ํ๋ก์ฐ ํด์ ๋ฅผ ์ํ๋ ์ ์ ์ ID |
DELETE /user/52ff32f5ce6c300f55000003/followings >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
| Name | Description |
|---|---|
| token | ์ ์ ์ ํ ํฐ |
| Name | Description |
|---|---|
| id | ์ ์ ์ ID |
| name | ์ด๋ฆ |
| status_message | ์ ์ ํ๋กํ์ ์ํ ๋ฉ์ธ์ง |
| picture | ์ ์ ์ ํ๋กํ ์ฌ์ง (Metadata ID) |
| gender | ์ฑ๋ณ (๋จ์=0, ์ฌ์=1) |
| pw | ํจ์ค์๋ (MD5 ํด์ฑ ํ์!) |
PATCH /user/52ff32f5ce6c300f55000003 name="๊น๋ฃ์ค" status_message="์์ ๋ ์ํ ๋ฉ์ธ์ง!" pw='24b7059cb0f4df701401ddf854d770ee' // MD5("Halloo") >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
ํ์์ ํํดํ๊ณ DB์์ ๋ชจ๋ ๋ฐ์ดํฐ๋ฅผ ์ง์๋๋ค.
| Name | Description |
|---|---|
| token | ์ ์ ์ ํ ํฐ |
DELETE /user/52ff32f5ce6c300f55000003/followings >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
๋ชจ๋ ํด๋ฌ์น๋ ํด๋ฌ์น๋ถ์ ์กด์๋๋ค. ๊ทธ๋ ๋ค๊ณ ํด๋ฌ์น์ ๋ฆฌ์์ค๋ ํด๋ฌ์น๋ถ ์์ ์ํด์์ง ์์ผ๋ฉฐ ๋
์์ ์ด๋ค. (/clutch) ๋ํ, ์์ ์ด ํด๋ฌ์น๋ฅผ ์ฌ๋ฆฌ๊ณ ์ข์์๋ฅผ ๋๋ฅด๋ ๋ฑ์ ๊ธฐํ ํ๋๋ค์ ๋ชจ๋ ์์ ์ ํ๋ก์๋ค์๊ฒ ์๋ฆผ์ด ์ ๋ฌ๋๋ค. **๋ํ ํด๋ฌ์น์ ๊ด๋ จ๋ ๋ชจ๋ ํ๋๋ค์ Header์ token์ ํตํ ์ ์ ์ธ์ฆ์ด ํ์ํ์ง๋ง ๋ฌธ์์๋ ์ ๋ถ ์ค๋ณต ๊ธฐ์ฌํ์ง ์๊ฒ ๋ค. ์ด๊ฒ์ ๊ธฐ๋ณธ ์๊ตฌ์ฌํญ์ด๋ค. **
| Name | Description |
|---|---|
| tags | ํด๋ฌ์น์ ๋ค์ด๊ฐ๋ ํ๊ทธ๋ค (์ผํ๋ก ๊ตฌ๋ถ) |
| cb_id | ์ด ํด๋ฌ์น๊ฐ ์ํ๋ ํด๋ฌ์น๋ถ ID |
| content_type | ์ฌ์ง: 0, ๋์์: 1, ๋งํฌ: 2 |
| content_pictures | (์ฌ์ง์ผ ๊ฒฝ์ฐ) ์ฌ์ง์ ๋ฉํ๋ฐ์ดํฐ ID๋ค (๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ) |
| content_link | (๋์์/๋งํฌ์ผ ๊ฒฝ์ฐ) ํด๋นํ๋ URL |
| content_body | ๊ธ ๋ด์ฉ |
| Name | Description |
|---|---|
| clutchId | ์ด ํด๋ฌ์น์ ID |
POST /clutch cb_id="30501304" tags="์กด์,์ฌ์ ,๊ฑธ์ค๋ฐ์ด"" content_type=0 content_pictures="pic1id pic2id pic3id" content_body="๋ฏผ์ ์กด์..." >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, clutchId: fa4230491alf }
========
| Name | Description |
|---|---|
| sort | ์ ๋ ฌ. (0: ์ธ๊ธฐ์, 1: ์ต์ ์) |
| pageNo | ์์ฒญํ๋ ํ์ด์ง ๋ฒํธ |
| pageCount | ํ ํ์ด์ง๋น ๋ก๋ฉํ ํด๋ฌ์น ๊ฐฏ์ |
| Name | Description |
|---|---|
| clutches | ๋ก๋ฉ๋ ํด๋ฌ์น ๋ชฉ๋ก(๋ฆฌ์คํธ) |
| clutches.clutchId | ์ด ํด๋ฌ์น์ ID |
| clutches.cb_id | ํด๋ฌ์น๋ถ์ ID |
| clutches.cb_name | ํด๋ฌ์น๋ถ ์ด๋ฆ |
| clutches.userId | ํด๋ฌ์น๋ฅผ ์ฌ๋ฆฐ ์ ์ ์ ID |
| clutches.userName | ํด๋ฌ์น๋ฅผ ์ฌ๋ฆฐ ์ ์ ์ ์ด๋ฆ |
| clutches.userPhoto | ํด๋ฌ์น๋ฅผ ์ฌ๋ฆฐ ์ ์ ์ ํ๋กํ ์ฌ์ง |
| clutches.content_type | ํด๋ฌ์น ์ข ๋ฅ |
| clutches.content_pictures | (์ต์ , ์ฌ์ง๋ง) ์ฌ์ง๋ค (๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ) |
| clutches.content_link | (์ต์ , ๋์์ ๋ฐ ๋งํฌ๋ง) ๋งํฌ URL |
| clutches.content_link_thumb | (์ต์ , ๋์์ ๋ฐ ๋งํฌ๋ง) ๋งํฌ ์ธ๋ค์ผ ์ด๋ฏธ์ง |
GET /clutch sort=0 pageNo=0 pageCount=50 >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, clutches: [ { clutchId: "fa4230491alf", cb_id: "fa4230491alf", cb_name: "๊ฑธ์ค๋ฐ์ด", userId: "fa4230491alf", userName: "์ ๊ด์", userPhoto: "(no pic)", content_type: 0, content_pictures: "pic1id pic2id" }, { clutchId: "fa4230491alf", cb_id: "fa4230491alf", cb_name: "์๋ ์๋", userId: "fa4230491alf", userName: "์ดํธ์ฐ" userPhoto: "(no pic)", content_type: 1, content_link: "http://thedeblur.com:1129/videos/1934205" content_link_thumb: "(no pic)" } ] }
========
| Name | Description |
|---|---|
| clutchId | ์ง์ฐ๊ณ ์ถ์ ํด๋ฌ์น์ ID |
DELETE /clutch/fa4230491alf >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
| Name | Description |
|---|---|
| clutchId | ์ข์ํ๋ ํด๋ฌ์น์ ID |
POST /clutch/fa4230491alf/like >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
| Name | Description |
|---|---|
| clutchId | ์ข์์๋ฅผ ํด์ ํ ํด๋ฌ์น์ ID |
DELETE /clutch/fa4230491alf/unlike >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
| Name | Description |
|---|---|
| clutchId | ๋๊ธ์ ๊ฐ์ ธ์ฌ ํด๋ฌ์น์ ID |
| pageNo | ์์ฒญํ๋ ํ์ด์ง ๋ฒํธ |
| pageCount | ํ ํ์ด์ง๋น ๋ก๋ฉํ ๋๊ธ ๊ฐฏ์ |
| Name | Description |
|---|---|
| comments | ๋ก๋ฉ๋ ๋๊ธ ๋ชฉ๋ก |
| comments.commentId | ์ด ํด๋ฌ์น์ ID |
| comments.userId | ๋๊ธ์ ์ด ์ ์ ์ ID |
| comments.userName | ๋๊ธ์ ์ด ์ ์ ์ ์ด๋ฆ |
| comments.userPhoto | ๋๊ธ์ ์ด ์ ์ ์ ํ๋กํ ์ฌ์ง |
| comments.body | ๋๊ธ ๋ด์ฉ |
| comments.date | ๋๊ธ์ ์ด ์๊ฐ (Timestamp) |
| comments.likeCount | ๋๊ธ์ด ๋ฐ์ ์ถ์ฒ ๊ฐฏ์ |
| comments.unlikeCount | ๋๊ธ์ด ๋ฐ์ ๋น์ถ์ฒ ๊ฐฏ์ |
GET /clutch/fa4230491alf/comments pageNo=0 pageCount=50 >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, comments: [ { commentId: "fa4230491alf", userId: "fa4230491alf" userName: "๊นํจ์ค", userPhoto: "(no pic)", body: "์... ์ ๋ง ์์๋ค์", likeCount: 0, unlikeCount: 0, date: 1292667739248 }, { commentId: "fa4230491alf", userId: "fa4230491alf", userName: "ํ๊ธธ๋", userPhoto: "(no pic)", body: "์ง์ฌ ๋๋ฌด ์์๋ค์", likeCount: 1, unlikeCount: 0, date: 1392667736248 }] }
========
| Name | Description |
|---|---|
| clutchId | ๋๊ธ ์ญ์ ์ ๋์์ด ๋๋ ํด๋ฌ์น์ ID |
| commentId | ์ญ์ ํ ๋๊ธ์ ID |
DELETE /clutch/fa4230491alf/comments/104059/delete >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
DELETE ๋ช ๋ น์ด๋ฅผ ํตํด ์ถ์ฒ์ ํด์ ํ ์ ์๋ค.
| Name | Description |
|---|---|
| clutchId | ๋๊ธ ์ถ์ฒ์ ๋์์ด ๋๋ ํด๋ฌ์น์ ID |
| commentId | ์ถ์ฒํ ๋๊ธ์ ID |
| Code | Status | Message |
|---|---|---|
| 2002 | ALREADY_UNLIKED | ์ด๋ฏธ ๋น์ถ์ฒ์ ๋๋ฅธ ์ํ์ |
POST /clutch/fa4230491alf/comments/104059/like >>>>>>>>>> { status: { code: 2002, message: "์ด๋ฏธ ๋น์ถ์ฒ์ ๋๋ฅด์ จ์ต๋๋ค." } }
========
DELETE ๋ช ๋ น์ด๋ฅผ ํตํด ๋น์ถ์ฒ์ ํด์ ํ ์ ์๋ค.
| Name | Description |
|---|---|
| clutchId | ๋๊ธ ์ถ์ฒ์ ๋์์ด ๋๋ ํด๋ฌ์น์ ID |
| commentId | ์ถ์ฒํ ๋๊ธ์ ID |
| Code | Status | Message |
|---|---|---|
| 2001 | ALREADY_LIKED | ์ด๋ฏธ ์ถ์ฒ์ ๋๋ฅธ ์ํ์ |
POST /clutch/fa4230491alf/comments/104059/like >>>>>>>>>> { status: { code: 2001, message: "์ด๋ฏธ ์ถ์ฒ์ ๋๋ฅด์ จ์ต๋๋ค." } }
๋ชจ๋ ํด๋ฌ์น๋ ํด๋ฌ์น๋ถ์ ์กด์๋๋ค. ํด๋ฌ์น๋ถ์ ๋ฆฌ์์ค๋ ์ ์ ์์ ์ํด์๋ค. (/user/:userId/cb)
๋ํ, ํด๋ฌ์น๋ถ์ ์ง์นญํ ๋๋ clutchbook์ด ์๋ cb๋ก ์ง์นญํ๋ค.
| Name | Description |
|---|---|
| name | ํด๋ฌ์น๋ถ ์ด๋ฆ |
| desc | ํด๋ฌ์น๋ถ ์ค๋ช |
| coverPics | ํด๋ฌ์น๋ถ ์ปค๋ฒ๋ค |
| tags | ๋ค์ด๊ฐ๋ ํ๊ทธ๋ค (์ผํ๋ก ๊ตฌ๋ถ) |
| Name | Description |
|---|---|
| cb_id | ์ด ํด๋ฌ์น๋ถ์ ID |
POST /user/fa4230491alf/cb name="๊ฑธ์ค๋ฐ์ด" desc="๊ฑธ์ค๋ฐ์ด ์ฌ์ง ์ ์ฅํ๋ ๊ณณ!" tags="์กด์,์ฌ์ ,๊ฑธ์ค๋ฐ์ด"" >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, cb_id: fa4230491alf }
========
| Name | Description |
|---|---|
| cb_id | ์ง์ฐ๋ ค๋ ํด๋ฌ์น๋ถ ID |
DELETE /user/fa4230491alf/cb/aa31347f >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" } }
========
| Name | Description |
|---|---|
| cb_id | ์์ฒญํ๋ ํด๋ฌ์น๋ถ ID |
| sort | ์ ๋ ฌ (0: ์ธ๊ธฐ์, 1: ์ต์ ์) |
| pageNo | ์์ฒญํ๋ ํ์ด์ง ๋ฒํธ |
| pageCount | ํ ํ์ด์ง๋น ๋ก๋ฉํ ๋๊ธ ๊ฐฏ์ |
| Name | Description |
|---|---|
| clutches | ๋ก๋ฉ๋ ํด๋ฌ์น ๋ชฉ๋ก(๋ฆฌ์คํธ) |
| clutches.clutchId | ์ด ํด๋ฌ์น์ ID |
| clutches.cb_id | ํด๋ฌ์น๋ถ์ ID |
| clutches.cb_name | ํด๋ฌ์น๋ถ ์ด๋ฆ |
| clutches.userId | ํด๋ฌ์น๋ฅผ ์ฌ๋ฆฐ ์ ์ ์ ID |
| clutches.userName | ํด๋ฌ์น๋ฅผ ์ฌ๋ฆฐ ์ ์ ์ ์ด๋ฆ |
| clutches.userPhoto | ํด๋ฌ์น๋ฅผ ์ฌ๋ฆฐ ์ ์ ์ ํ๋กํ ์ฌ์ง |
| clutches.content_type | ํด๋ฌ์น ์ข ๋ฅ |
| clutches.content_pictures | (์ต์ , ์ฌ์ง๋ง) ์ฌ์ง๋ค (๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ) |
| clutches.content_link | (์ต์ , ๋์์ ๋ฐ ๋งํฌ๋ง) ๋งํฌ URL |
| clutches.content_link_thumb | (์ต์ , ๋์์ ๋ฐ ๋งํฌ๋ง) ๋งํฌ ์ธ๋ค์ผ ์ด๋ฏธ์ง |
GET /user/fa4230491alf/cb/1853ffba sort=0 pageNo=0 pageCount=50 >>>>>>>>>> { status: { code: 200, message: "์ฑ๊ณต" }, clutches: [ { clutchId: "fa4230491alf", cb_id: "fa4230491alf", cb_name: "๊ฑธ์ค๋ฐ์ด", userId: "fa4230491alf", userName: "์ ๊ด์", userPhoto: "(no pic)", content_type: 0, content_pictures: "pic1id pic2id" }, { clutchId: "fa4230491alf", cb_id: "fa4230491alf", cb_name: "๊ฑธ์ค๋ฐ์ด", userId: "fa4230491alf", userName: "์ดํธ์ฐ" userPhoto: "(no pic)", content_type: 1, content_link: "http://thedeblur.com:1129/videos/1934205" content_link_thumb: "(no pic)" } ] }
========