-
Notifications
You must be signed in to change notification settings - Fork 2
API ๋ช ์ธ
ChanYoung Jo edited this page Jul 27, 2022
·
281 revisions
๋๋ถ๋ฅ | ๊ธฐ๋ฅ | method | URI |
---|---|---|---|
์๋ฒ ์ํ ์ฒดํฌ | ์๋ฒ ์ํ ์ฒดํฌ | GET | /api/health, /chat/health |
์ธ์ฆ ๊ด๋ จ | ๋ก๊ทธ์ธ | POST | /api/auth/login |
๋ก๊ทธ์์ | POST | /api/auth/logout | |
์ ์ ๊ด๋ จ | ํ์๊ฐ์ | POST | /api/users/join |
ํ์์ ๋ณด ์กฐํ(์๊ธฐ ์์ ์ ๋ณด ์กฐํ) | GET | /api/users | |
ํ์์ ๋ณด ์กฐํ | GET | /api/users/{user-id} | |
ํ์์ ๋ณด ์์ | PUT | /api/users | |
๋๋ค์ ์ค๋ณต ์ฒดํฌ | GET | /api/users/nickname | |
๋งค๋ํ๊ฐ ๊ด๋ จ | ๋งค๋ํ๊ฐ ํ๊ธฐ | POST | /api/users/manner |
๋งค๋ํ๊ฐ ์กฐํ | GET | /api/users/manner/{user-id} | |
์นดํ ๊ณ ๋ฆฌ ๊ด๋ จ | ์นดํ ๊ณ ๋ฆฌ ๋ชฉ๋ก ์กฐํ | GET | /api/categories |
์นดํ ๊ณ ๋ฆฌ ํ ๊ฑด ์กฐํ | GET | /api/categories/{category-id} | |
๋ฌผํ ๊ด๋ จ | ๋ฌผํ ๋ฆฌ์คํธ ์กฐํ(ํ์ ์ ์ฉ) | GET | /api/products |
๋ฌผํ ์์ธ ์ ๋ณด ์กฐํ | GET | /api/products/{product-id} | |
๋ฌผํ ๋ฑ๋ก | POST | /api/products | |
๋ฌผํ ์์ | PUT | /api/products/{product-id} | |
๋ฌผํ ์ญ์ | DELETE | /api/products/{product-id} | |
๋ฌผํ ์ํ ๋ณ๊ฒฝ | PUT | /api/products/state/{product-id} | |
๋ฌผํ ๋์ด์ฌ๋ฆฌ๊ธฐ | PUT | /api/products/refreshment/{product-id} | |
๋ฌผํ ํ๋งค ๋ด์ญ ์กฐํ | GET | /api/products/sales-history | |
๋ฌผํ ๊ตฌ๋งค ๋ด์ญ ์กฐํ | GET | /api/products/purchase-history | |
์ฐํ๊ธฐ ๊ด๋ จ | ์ฐํ ์ํ ๋ชฉ๋ก ์กฐํ | GET | /api/favorite-products |
์ฐํ๊ธฐ ๋ฑ๋ก | POST | /api/favorite-products | |
์ฐํ๊ธฐ ์ญ์ | DELETE | /api/favorite-products/{favorite-id} | |
์ฐํ๊ธฐ ์ญ์ (๋ฌผํ ID๋ก) | DELETE | /api/favorite-products/products/{product-id} | |
๊ฑฐ๋ ํ๊ธฐ ๊ด๋ จ | ์ ์ฒด ํ๊ธฐ ์กฐํ | GET | /api/sale-reviews/user/{user-id} |
ํ๋งค์ ํ๊ธฐ ์กฐํ | GET | /api/sale-reviews/seller/{user-id} | |
ํ๋งค์ ํ๊ธฐ ๋ฑ๋ก | POST | /api/sale-reviews/seller | |
ํ๋งค์ ํ๊ธฐ ์์ | PUT | /api/sale-reviews/seller/{sale-review-id} | |
ํ๋งค์ ํ๊ธฐ ์ญ์ | DELETE | /api/sale-reviews/seller/{sale-review-id} | |
๊ตฌ๋งค์ ํ๊ธฐ ์กฐํ | GET | /api/sale-reviews/buyer/{user-id} | |
๊ตฌ๋งค์ ํ๊ธฐ ๋ฑ๋ก | POST | /api/sale-reviews/buyer | |
๊ตฌ๋งค์ ํ๊ธฐ ์์ | PUT | /api/sale-reviews/buyer/{sale-review-id} | |
๊ตฌ๋งค์ ํ๊ธฐ ์ญ์ | DELETE | /api/sale-reviews/buyer/{sale-review-id} | |
๋ฐ์ ํ๊ธฐ ์จ๊ธฐ๊ธฐ | PUT | /api/sale-reviews/hide/{sale-review-id} | |
์๋ฆผ ๊ด๋ จ | ์๋ฆผ ๋ชฉ๋ก ์กฐํ | GET | /api/notifications |
์๋ฆผ ์ฝ์ ์ฒ๋ฆฌ | PUT | /api/notifications/{notification-id} | |
์๋ฆผ ์ญ์ ์ฒ๋ฆฌ | DELETE | /api/notifications/{notification-id} | |
์ฑํ ๊ด๋ จ | ์ฑํ ๋ฐฉ ์์ฑ | POST | /api/chat-rooms |
์ฑํ ๋ฐฉ ๋ชฉ๋ก ์กฐํ | GET | /api/chat-rooms | |
์ฑํ ๋ฐฉ ์์ธ ์ ๋ณด ์กฐํ | GET | /api/chat-rooms/{chat-room-id} | |
ํ๋งค์ค์ธ ์ํ์ ๋ํ ์ฑํ ๋ฐฉ ์ฐธ์ฌ์ ๋ชฉ๋ก ์กฐํ | GET | /api/chat-rooms/product/{product-id} | |
์ฑํ ๋ฐฉ ์ด๋ํ๊ธฐ | PUT | /chat/chat-rooms/invitation/{chat-room-id} | |
์ฑํ ๋ฐฉ ๋๊ฐ๊ธฐ | PUT | /chat/chat-rooms/exit/{chat-room-id} | |
์ฑํ ์ด๋ฏธ์ง ์์ฑ | POST | /chat/messages/images | |
์ฑํ ๋ฉ์์ง ๋ณด๋ด๊ธฐ | POST | /chat/messages | |
์ฑํ ๋ฐฉ ๋ฉ์์ง ๋ชฉ๋ก ์กฐํ | GET | /chat/messages | |
์ฝ์ ๋ฉ์์ง ๊ฐฏ์ ๊ฐฑ์ | PUT | /chat/messages/read-size |
- request ์ application/json ์ฌ์ฉ
- response ์ ๋ง์ฐฌ๊ฐ์ง๋ก content-type ์ application/json ์ผ๋ก ์๋ตํจ
-
ํ์ ์ธ์ฆ์ด ํ์ํ API์ ๊ฒฝ์ฐ ์ถ๊ฐํด์ผํจ(๋นํ์ ์ ์ธ)
key type value api_key string Bearer {jwt} -
api_key value์ ์์
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJuaWNrTmFtZSI6ImtldmluX3N1Z28iLCJyb2xlcyI6WyJST0xFX1VTRVIiXSwiaXNzIjoiYWxnb3JpdGhtX3F1aXpfY3VyYXRvciIsImV4cCI6MTYyNzE5ODQwNSwiaWF0IjoxNjI3MTk0ODA1LCJ1c2VySWQiOiJ6b3JvXzI4MjUiLCJ1c2VyS2V5IjoyOH0.Ahl9IuevGfDTxxVlowf9RWAPPFcXKAsJuGLpXNTGYFxTlmWCBGl0Otgjn3LKslEynv8wo6yxuOZ1vvrJCWo-kw
- ๋ฐ์ดํฐ ํ์
key type value success boolean ์๋ต์ฑ๊ณต์ true, ์คํจ์ false response Object ์์ฒญ์ ๋์ํ๋ ๊ฒฐ๊ณผ / ์๋ต์คํจ์ null error Object ์๋ต์คํจ์ ์คํจ์์ธ ๋ฐ HTTP์๋ฌ์ฝ๋์ ์๋ชป๋ ์์ฒญ ํ๋ ๋ฆฌ์คํธ / ์๋ต์ฑ๊ณต์ null - ๋ฐ์ดํฐ ์์ (์ฑ๊ณต ์๋ต)
{ "success": true, "response": { "์๋ต ๋ด์ฉ(์คํธ๋ง์ด ์๋๋ผ ๊ฐ์ฒด)" }, "error": null }
- ์ค์ ์์ฒญํ๋ ๋ด์ฉ์ด response ์ ๋ด์ฉ์์ ๋ค์ด์๊ฒ ๋จ
- ๋ฐ์ดํฐ ์์ (์คํจ ์๋ต)
{ "success": false, "response": null, "error": { "message": "์๋ฌ ๋ด์ฉ", "status": 500, "invalid_fields": null } }
- error.status ๋ HTTP status code ์ด๊ณ ํญ์ 500์ผ๋ก ๊ณ ์ ๋์ด ์๋๊ฒ์ด ์๋๋ผ ์๋ฌ ์ข ๋ฅ์ ๋ฐ๋ผ ๋ฐ๋ ์ ์์
- API ๋ช ์ธ์ ๊ด๋ จ์๋ ๊ณตํต๋ ์ฌํญ๋ค์ ์ ์ํฉ๋๋ค.
- Request ๋ช
์ธ์์
required๊ฐ true
์ธ ํ๋(request body๋ request param)๋ฅผ ๋ฃ์ง ์์ ๊ฒฝ์ฐ์ ๋๋ค. - ์๋์ ๊ฐ์ ํํ๋ก
400
์๋ต์ผ๋ก ๋ด๋ ค์ค๋๋ค.- ์ ํจํ์ง ์์ ์กฐ๊ฑด์ธ request body ํ๋๋
invalid_fields
์ ์์ต๋๋ค.
- ์ ํจํ์ง ์์ ์กฐ๊ฑด์ธ request body ํ๋๋
- API ๋ช
์ธ์์
'์์ฒญ parameter๊ฐ ์ฌ๋ฐ๋ฅด์ง ์์ ๊ฒฝ์ฐ'๋ ๋ณ๋์ ์คํจ ์ผ์ด์ค๋ก ์ ์ํ์ง ์์ต๋๋ค.
"error": {
"message": "Bad request exception occurred",
"status": 400,
"invalid_fields": {
"nickname": "nickname ๊ฐ์ ํ์์
๋๋ค.",
"location": "location ๊ฐ์ ํ์์
๋๋ค."
}
}
"error": {
"message": "Required request parameter 'state' for method parameter type int is not present",
"status": 400,
"invalid_fields": null
}
- ์๋์ ๊ฐ์ ํํ๋ก
404
์๋ต์ผ๋ก ๋ด๋ ค์ค๋๋ค. - API ๋ช
์ธ์์
'์์ฒญํ ๋ฐ์ดํฐ๊ฐ ์กด์ฌํ์ง ์๋ ๊ฒฝ์ฐ'๋ ๋ณ๋์ ์คํจ ์ผ์ด์ค๋ก ์ ์ํ์ง ์์ต๋๋ค.
"error": {
"message": "Could not found 'User' with query values (userId = 10)",
"status": 404,
"invalid_fields": null
}
"error": {
"message": "Could not found 'ProductQueryDto' with query values (productId = 100)",
"status": 404,
"invalid_fields": null
}
- ํ์ด์ง ์ต์
์ด ํ์ํ ๊ฒฝ์ฐ
page
,size
๋ฅผ ์ถ๊ฐ Query paramter๋ก ์ ๋ฌํ๋ค. - API ๋ช
์ธ์ ๋ณ๋์ ์ต์
์ด ์๋ค๋ฉด
๊ธฐ๋ณธ ํ์ด์ง ์ฌ์ด์ฆ
๋ 20,๋ฐ์ดํฐ ์ ๋ ฌ ๊ธฐ์ค
์ id(PK) ๊ธฐ์ค ๋ด๋ฆผ์ฐจ์ ์ ๋ ฌ
/api/products?page=2&size=2
- ์ด๋ฏธ์ง ์ฒ๋ฆฌ๋
pre-signed URL
์ ์ฌ์ฉํ๋ค.
- ๋ฌผํ ๋ฑ๋ก ์์ฒญ ์ ์ด๋ฏธ์ง ํ์ผ๋ช
์ ํจ๊ป ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋ฌผํ ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ ์ ์๋
pre-signed URL
์ ๋ฐ๊ธํ๋ค. -
pre-signed URL
์ ์ฌ์ฉํด์ S3์ ํ์ผ์ ์ ๋ก๋ํ๋ ์ญํ ์ Client์ ๋ชซ -
pre-signed URL
์ ์ฌ์ฉํด์ ์๋ฒ๋ DB์ ํด๋น ๊ฒฝ๋ก๋ฅผ ์ ์ฅํด๋๋๋ค. - ์ดํ์ ์์ธ์กฐํ, thumb-nail ์กฐํ ๋ฑ ์ด๋ฏธ์ง ์กฐํ ์
pre-signed URL
์ ์ค์ ํ์ผ์ด ๋ฑ๋ก๋์ด์์ง ์์ ๊ฒฝ์ฐ 404 ์๋ต์ด ๋๊ฐ๋ค (S3 ์คํ)
- ์๋ API ๋ฌธ์์์ ํํํ
Response์ '์ฑ๊ณต' ํญ๋ชฉ
์ ์ค์ ์๋ต์response
๋ถ๋ถ๋ง์ ํ๊ธฐํ๋ค. (success, error๋ ํ๊ธฐํ์ง ์์) - ์๋ API ๋ฌธ์์์ ํํํ
Response์ '์คํจ' ํญ๋ชฉ
์ ์ค์ ์๋ต์error
๋ถ๋ถ๋ง์ ํ๊ธฐํ๋ค. (success, response๋ ํ๊ธฐํ์ง ์์) - ํ์ ์ธ์ฆ์ด ํ์ํ์ง ์์ API๋ ๋ณ๋๋ก
ํ์ ์ธ์ฆ์ด ํ์ํ์ง ์์ API
๋ผ๊ณ ๊ธฐ์ ํ๋ค.- API ๋ช ์ธ์ 'ํ์ ์ธ์ฆ์ด ํ์ํ์ง ์์ API'๋ผ๋ ๋ด์ฉ์ด ์๋ค๋ฉด ํ์ ์ธ์ฆ์ด ํ์ํ API๋ก Request Header์ Jwt ์ถ๊ฐ ํ์.
ํ์ ์ธ์ฆ์ด ํ์ํ์ง ์์ API
- ์๋ฒ ์ํ ์ฒดํฌ API
- API ์๋ฒ:
GET /api/health
- CHAT ์๋ฒ:
GET /chat/health
- ์ฑ๊ณต(200)
- ํ์ฌ timestamp๋ฅผ ๋ฆฌํดํ๋ค.
{
"response": 1650430789815
}
ํ์ ์ธ์ฆ์ด ํ์ํ์ง ์์ API
- ํ์๊ฐ์ ์ ํ ์ฌ์ฉ์๋ ๋ก๊ทธ์ธ์ ํ ์ ์๋ค.
- ์ ์์ฌํญ
- ์ฌ์ฉ์๊ฐ ์ต์ด ๊ฐ์
ํ
ํ์์ ๋ณด ์์ API
๋ฅผ ํตํด ํ๋กํ ์ด๋ฏธ์ง๋ฅผ ๋ฑ๋กํ์ง ์์ผ๋ฉด์ ํจํ์ง ์์ presigned-url
์ด ๋ฐ๊ธ๋๋ค.- ํด๋น ๊ฒฝ๋ก๋ก ์ ๊ทผ์ 404 ๋ฆฌํด(AWS ์คํ)
- ์ฌ์ฉ์๊ฐ ์ต์ด ๊ฐ์
ํ
POST /api/auth/login
param | type | required | description |
---|---|---|---|
access_token | body | true | ์นด์นด์ค ๋ก๊ทธ์ธ API access_token |
{
"access_token": "yz6123kepyF2qasdfkar1234dGvQ321HrSasdfx0I2341PDZYigqe_04E40w"
}
- ์ฑ๊ณต(200)
์ต์ด ๋ก๊ทธ์ธ ์
{
"api_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJvYXV0aElkIjoyMTcyNjMxOTY1LCJyb2xlcyI6WyJST0xFX1VTRVIiXSwiaXNzIjoiZGFhbmduLXNlcnZlciIsImlkIjo2LCJtYW5uZXIiOjM2LjUsImV4cCI6MTY1NTQ2MjM1MCwiaWF0IjoxNjU1NDU1MTUwfQ.1Vo1JK6vCVvxQDHGtVq7_pRK69MrsiKIF4wUrpK5wiYRE95kPu9zGbzxkr1utNR_-hSER-AV8bJ7v37RIPt2xw",
"nickname": null,
"location": null,
"profile_url": null,
"manner": 36.5
}
ํ์ ์ ๋ณด ์์ ํ ๋ก๊ทธ์ธ ์
{
"api_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJvYXV0aElkIjoyMTcyNjMxOTY1LCJyb2xlcyI6WyJST0xFX1VTRVIiXSwiaXNzIjoiZGFhbmduLXNlcnZlciIsIm5pY2tuYW1lIjoi7YWM7Iqk7Yq4IOuLieuEpOyehCIsImxvY2F0aW9uIjoi7ISc7Jq47IucIOqwleuPmeq1rCIsImlkIjoxLCJtYW5uZXIiOjM2LjUsImV4cCI6MTY1ODQ3NDI5OCwiaWF0IjoxNjU4NDY3MDk4fQ.C66bFI6MpcUSpyIAShWcUQTyVCnW0exxSMZyZ9viGlZlQk4yQnVOqJxEEuEly_uFBzQ4RDOCrqvUDcARnesAIA",
"nickname": "ํ
์คํธ ๋๋ค์",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"profile_url": "https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/profile-image/1/profile_image.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220722T051818Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220722%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=d7e7247053ba7b6fb0a92f35e62b983beba6839679609c269ac0e0d16b2841f3",
"manner": 36.5
}
- ๋ก๊ทธ์ธํ ์ฌ์ฉ์๋ ๋ก๊ทธ์์์ ํ ์ ์๋ค.
POST /api/auth/logout
param | type | required | description |
---|---|---|---|
access_token | body | true | ์นด์นด์ค ๋ก๊ทธ์ธ API access_token |
{
"access_token": "yz6123kepyF2qasdfkar1234dGvQ321HrSasdfx0I2341PDZYigqe_04E40w"
}
- ์ฑ๊ณต(200)
{
}
ํ์ ์ธ์ฆ์ด ํ์ํ์ง ์์ API
- ์ฌ์ฉ์๋ ํ์๊ฐ์
์ ํ ์ ์๋ค.
- ์นด์นด์ค ํ๋กํ ์ด๋ฏธ์ง ํ์ผ ๊ฒฝ๋ก์ ์ ๊ทผํ๊ธฐ ์ํด presigned-url์ด ์๋
original-url
์ ๋ฆฌํดํ๋ค. - API ํธ์ถ ๊ฒฐ๊ณผ๋ก
profile_url
์ ๋ฐ๊ณ ํ์์ ๋ณด ์์ API ํธ์ถ์ ํตํด ํ๋กํ ์ด๋ฏธ์ง ๋ฑ๋ก์ ์ํpresigned-url
์ ๋ฐ๊ธ๋ฐ์์ผ ํ๋ค.
- ์นด์นด์ค ํ๋กํ ์ด๋ฏธ์ง ํ์ผ ๊ฒฝ๋ก์ ์ ๊ทผํ๊ธฐ ์ํด presigned-url์ด ์๋
POST /api/users/join
param | type | required | description |
---|---|---|---|
access_token | body | true | ์นด์นด์ค ๋ก๊ทธ์ธ API access_token |
{
"access_token": "yz6123kepyF2qasdfkar1234dGvQ321HrSasdfx0I2341PDZYigqe_04E40w"
}
- ์ฑ๊ณต(200)
{
"id": 1,
"oauth_id": 2172631965,
"profile_url": "http://k.kakaocdn.net/dn/64fac/btryDjlyt8p/QFcrbqBCShUTP5e7KQ6Pf1/img_640x640.jpg"
}
- ์คํจ(401)
- ์ ํจํ์ง ์์ ํ ํฐ์ผ๋ก ์์ฒญ ์
{
"message": "401 Unauthorized: \"{\"msg\":\"this access token does not exist\",\"code\":-401}\"",
"status": 401,
"invalid_fields": null
}
- ๋ก๊ทธ์ธํ ์ฌ์ฉ์๋ ์๊ธฐ ์์ ์ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์๋ค.
- ์ ์์ฌํญ
- ์กฐํ ๋์์ธ ์ฌ์ฉ์๊ฐ ์ต์ด ๊ฐ์
ํ
ํ์์ ๋ณด ์์ API
๋ฅผ ํตํด ํ๋กํ ์ด๋ฏธ์ง๋ฅผ ๋ฑ๋กํ์ง ์์ผ๋ฉด์ ํจํ์ง ์์ presigned-url
์ด ๋ฐ๊ธ๋๋ค.- ํด๋น ๊ฒฝ๋ก๋ก ์ ๊ทผ์ 404 ๋ฆฌํด(AWS ์คํ)
- ์กฐํ ๋์์ธ ์ฌ์ฉ์๊ฐ ์ต์ด ๊ฐ์
ํ
GET /api/users
- None
- ์ฑ๊ณต(200)
{
"id": 6,
"oauth_id": 2172631965,
"nickname": "ํ
์คํธ ๋๋ค์",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"profile_url": "https://BUCKET.com/profile-image/92a0d23d-6f1e-427c-8e7e-82629d3d08c7img_110x110.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220617T084453Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220617%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=6c9a5ad2a9472b3d8beb6b953f42fe4546a2032a6e74354d402255b147d84faa",
"manner": 36.5
}
- ํ์ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์๋ค.
- ์ ์์ฌํญ
- ์กฐํ ๋์์ธ ์ฌ์ฉ์๊ฐ ์ต์ด ๊ฐ์
ํ
ํ์์ ๋ณด ์์ API
๋ฅผ ํตํด ํ๋กํ ์ด๋ฏธ์ง๋ฅผ ๋ฑ๋กํ์ง ์์ผ๋ฉด์ ํจํ์ง ์์ presigned-url
์ด ๋ฐ๊ธ๋๋ค.- ํด๋น ๊ฒฝ๋ก๋ก ์ ๊ทผ์ 404 ๋ฆฌํด(AWS ์คํ)
- ์กฐํ ๋์์ธ ์ฌ์ฉ์๊ฐ ์ต์ด ๊ฐ์
ํ
GET /api/users/{user-id}
- None
- ์ฑ๊ณต(200)
{
"id": 6,
"oauth_id": 2172631965,
"nickname": "ํ
์คํธ ๋๋ค์",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"profile_url": "https://BUCKET.com/profile-image/92a0d23d-6f1e-427c-8e7e-82629d3d08c7img_110x110.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220617T084453Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220617%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=6c9a5ad2a9472b3d8beb6b953f42fe4546a2032a6e74354d402255b147d84faa",
"manner": 36.5
}
- ์ฌ์ฉ์๋ ํ์์ ๋ณด๋ฅผ ์์ ํ ์ ์๋ค.
PUT /api/users
param | type | required | description |
---|---|---|---|
nickname | body | true | ๋๋ค์ |
location | body | true | ์ง์ญ ์ ๋ณด |
profile_url | body | true | ํ๋กํ ์ด๋ฏธ์ง("profile_image.jpg" ๋ฌธ์์ด ๊ณ ์ ์ผ๋ก .png, .jpeg, .jpg ํ์ฅ์๋ง ๊ฐ๋ฅ) |
{
"nickname": "ํ
์คํธ ๋๋ค์",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"profile_url": "profile_image.jpg"
}
- ์ฑ๊ณต(200)
{
"id": 1,
"profile_url": "https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/profile-image/1/profile_image.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220722T051703Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220722%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=7972a45e169c474e4f918b7fc01e68f4f4760aa8fb118cad80987f1312a13c3d"
}
- ์ฌ์ฉ์ค์ธ ๋๋ค์ ์ฌ๋ถ๋ฅผ ํ์ธํ ์ ์๋ค.
GET /api/users/nickname
param | type | required | description |
---|---|---|---|
name | query string | true | ์ค๋ณต ์ฌ๋ถ๋ฅผ ํ์ธํ ๋๋ค์ |
GET /api/users/nickname?name=ํ ์คํธ๋๋ค์1
GET /api/users/nickname?name=helloworld
- ์ฑ๊ณต(200)
- ์กด์ฌํ์ง ์๋ ๋๋ค์์ธ ๊ฒฝ์ฐ
{
"result": true
}
- ์ฑ๊ณต(200)
- ์ด๋ฏธ ์กด์ฌํ๋ ๋๋ค์์ธ ๊ฒฝ์ฐ
{
"result": false
}
POST /api/users/manner
param | type | required | description |
---|---|---|---|
user_id | body | true | ์ ์ id |
score | body | true | ๋งค๋์ ์ (-5~5 ์ฌ์ด์ ์ ์) |
{
"user_id": 1,
"score": 5
}
- ์ฑ๊ณต(200)
{
}
- ์คํจ(403)
{
"message": "Authority error (cause: ์๊ธฐ ์์ ์ ๋งค๋ํ๊ฐ๋ฅผ ํ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฌ์ฉ์์ ๋งค๋ํ๊ฐ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์๋ค.
- ๋งค๋ํ๊ฐ ์ ์ -5์ ~ 5์ ์ค์ ํ๊ฐ๊ฐ 1๊ฑด์ด์ ์กด์ฌํ๋ ์ ์๋ง ์๋ต์ ์ค๋ค.
GET /api/users/manner/{user-id}
- None
- ์ฑ๊ณต(200)
{
{
"score": -5,
"score_count": 2
},
{
"score": -4,
"score_count": 1
},
{
"score": -3,
"score_count": 1
},
{
"score": -2,
"score_count": 1
},
{
"score": -1,
"score_count": 1
},
{
"score": 1,
"score_count": 1
},
{
"score": 2,
"score_count": 1
},
{
"score": 3,
"score_count": 1
},
{
"score": 4,
"score_count": 1
},
{
"score": 5,
"score_count": 2
}
}
- ์ฑ๊ณต(200)
- ์ฌ์ฉ์์ ๋ํ ๋งค๋ํ๊ฐ๊ฐ ํ๋๋ ์๋ ๊ฒฝ์ฐ
{
"score": 0,
"score_count": 0
}
ํ์ ์ธ์ฆ์ด ํ์ํ์ง ์์ API
- ์ฌ์ฉ์๋ ์นดํ ๊ณ ๋ฆฌ ๋ชฉ๋ก์ ์กฐํํ ์ ์๋ค.
GET /api/categories
- None
- ์ฑ๊ณต(200)
[
{
"id": 1,
"name": "๋์งํธ๊ธฐ๊ธฐ"
},
{
"id": 2,
"name": "์ํ๊ฐ์ "
},
{
"id": 3,
"name": "๊ฐ๊ตฌ/์ธํ
๋ฆฌ์ด"
},
{
"id": 4,
"name": "์ ์๋"
},
{
"id": 5,
"name": "์ํ/๊ฐ๊ณต์ํ"
},
{
"id": 6,
"name": "์ ์๋์"
},
{
"id": 7,
"name": "์คํฌ์ธ /๋ ์ "
},
{
"id": 8,
"name": "์ฌ์ฑ์กํ"
},
{
"id": 9,
"name": "์ฌ์ฑ์๋ฅ"
},
{
"id": 10,
"name": "๋จ์ฑํจ์
/์กํ"
},
{
"id": 11,
"name": "๊ฒ์/์ทจ๋ฏธ"
},
{
"id": 12,
"name": "๋ทฐํฐ/๋ฏธ์ฉ"
},
{
"id": 13,
"name": "๋ฐ๋ ค๋๋ฌผ์ฉํ"
},
{
"id": 14,
"name": "๋์/ํฐ์ผ/์๋ฐ"
},
{
"id": 15,
"name": "์๋ฌผ"
},
{
"id": 16,
"name": "๊ธฐํ ์ค๊ณ ๋ฌผํ"
}
]
ํ์ ์ธ์ฆ์ด ํ์ํ์ง ์์ API
- ์ฌ์ฉ์๋ id์ ํด๋นํ๋ ์นดํ ๊ณ ๋ฆฌ๋ฅผ ์กฐํํ ์ ์๋ค.
GET /api/categories/{category-id}
- None
- ์ฑ๊ณต(200)
{
"id": 2,
"name": "์ํ๊ฐ์ "
}
- ์ฌ์ฉ์๋ ๋ฌผํ ๋ชฉ๋ก์ ์กฐํํ ์ ์๋ค.
- ํ์์ผ๋ก ์กฐํํ๋ ๊ฒฝ์ฐ ํ์ฌ ๋ก๊ทธ์ธํ ์ฌ์ฉ์์ ์์น์ ์ผ์นํ๋ ๋ฌผํ ๋ชฉ๋ก๋ง ์ต์ ๋ฑ๋ก์์ผ๋ก ๋ณด์ฌ์ค๋ค.
- ํ์ด์ง ์ฌ์ด์ฆ: 5
GET /api/products
GET /api/products?title=๋งฅ๋ถ
GET /api/products?category=3
GET /api/products?category=1,2,3
GET /api/products?title=๋งฅ๋ถ&category=5
GET /api/products?title=๋งฅ๋ถ&category=1,2,5
GET /api/products?min-price=120000
GET /api/products?min-price=120000&max-price=null
GET /api/products?title=๋งฅ๋ถ&category=1,2,5&min-price=120000
GET /api/products?title=๋งฅ๋ถ&category=1,2,5&min-price=120000&max-price=null
GET /api/products?title=๋งฅ๋ถ&category=1,2,5&max-price=150000
GET /api/products?title=๋งฅ๋ถ&category=1,2,5&min-price=null&max-price=150000
GET /api/products?title=๋งฅ๋ถ&category=1,2,5&min-price=null&max-price=null
GET /api/products?title=๋งฅ๋ถ&category=1,2,5&min-price=120000&max-price=160000
param | type | required | description |
---|---|---|---|
title | query string | false | ํ๋งค๊ธ ์ ๋ชฉ |
category | query string | false | ์นดํ ๊ณ ๋ฆฌ id(ex.1,2,3,4,5) |
e.g. ์นดํ ๊ณ ๋ฆฌ 1๊ฑด ์กฐํ ์ - category=1 | |||
e.g. ์นดํ ๊ณ ๋ฆฌ 2๊ฑด ์ด์ ์กฐํ ์ - category=1,2,3,4,5 | |||
min-price | query string | false | ์ต์ ๊ฐ๊ฒฉ |
max-price | query string | false | ์ต๋ ๊ฐ๊ฒฉ |
- ์ฑ๊ณต(200)
[
{
"id": 14,
"title": "๊ทธ๋จ ํ๋๋ค",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"price": 9999,
"thumb_nail_image": null,
"favorite_count": 3,
"chatting_count": 2,
"created_at": "2022-06-05T00:56:13.273674"
},
{
"id": 13,
"title": "๋งฅ๋ถ ํ๋๋ค",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"price": 9999,
"thumb_nail_image": "https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/7f10531b-bff3-4ac0-b185-4e89f820c764test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T155616Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=c9ead73ed5a3b41cb536148ff0f3a5f048ab68298368c2a43c7edd75ba0e887d",
"favorite_count": 0,
"chatting_count": 0,
"created_at": "2022-06-05T00:49:31.365339"
}
]
- ์คํจ(400)
- ์์น ์ ๋ณด ๋ฏธ๋ฑ๋ก ์
{
"message": "๋ฌผํ ์กฐํ ์ ์์น ์ ๋ณด ๋ฑ๋ก์ด ํ์์
๋๋ค.",
"status": 400,
"invalid_fields": null
}
- ์ฌ์ฉ์๋ ๋ฌผํ ํ ๊ฑด์ ๋ํ ์์ธ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์๋ค.
GET /api/products/{product-id}
- None
- ์ฑ๊ณต(200)
- productImage๊ฐ ์กด์ฌํ์ง ์๋ ๊ฒฝ์ฐ
{
"id": 1,
"seller": {
"id": 1,
"name": "ํ
์คํธ๋๋ค์2"
},
"buyer": null,
"category_id": 1,
"name": "mockProduct1",
"price": 10000,
"title": "mockProduct ํ๋๋ค1",
"description": "mockProduct1 description",
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"product_state": "ํ๋งค์ค",
"view_count": 5,
"thumb_nail_image": null,
"product_images": [],
"favorite_count": 4,
"chatting_count": 5,
"is_favorite": true,
"created_at": "2022-06-11T07:09:40.744419"
}
{
"id": 1,
"seller": {
"id": 1,
"name": "ํ
์คํธ๋๋ค์2"
},
"buyer": {
"id": 3,
"name": "ํ
์คํธ๋๋ค์4"
},
"category_id": 1,
"name": "mockProduct1",
"price": 10000,
"title": "mockProduct ํ๋๋ค1",
"description": "mockProduct1 description",
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"product_state": "ํ๋งค์ค",
"view_count": 5,
"thumb_nail_image": null,
"product_images": [],
"favorite_count": 4,
"chatting_count": 5,
"is_favorite": true,
"created_at": "2022-06-11T07:09:40.744419"
}
- ์ฑ๊ณต(200)
- productImage๊ฐ ์กด์ฌํ๋ ๊ฒฝ์ฐ
{
"id": 13,
"seller": "ํ
์คํธ ๋๋ค์",
"seller_id": 6,
"buyer": null,
"category_id": 1,
"name": "๋งฅ๋ถ",
"price": 9999,
"title": "๋งฅ๋ถ ํ๋๋ค",
"description": "๋ฏธ์ค๊ณ ๋งฅ๋ถ ํ๋๋ค",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"product_state": "ํ๋งค์ค",
"view_count": 5,
"thumb_nail_image": "https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/7f10531b-bff3-4ac0-b185-4e89f820c764test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T155911Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=3fa60b260e7b6696b48ad2688a04b9fbbd44682d8f15a530df34be817446178f",
"product_images": [
"https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/7f10531b-bff3-4ac0-b185-4e89f820c764test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T155911Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=3fa60b260e7b6696b48ad2688a04b9fbbd44682d8f15a530df34be817446178f",
"https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/5363b1ea-b4da-40bc-aa39-482d65f48cc4test002.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T155911Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=316ccd7b305bf609e2bace758e9d16a25205c081dc0bf7ecd831a879483fd9a9",
"https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/4022b8fc-cf2a-49d0-8e8d-83a1f0181474test003.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T155911Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=57fbf0e52e407d4b4725983df350db6f4887815058404db98390fd2d24f85789"
],
"favorite_count": 0,
"chatting_count": 0,
"is_favorite": true,
"created_at": "2022-06-11T07:09:40.796542"
}
- ์ฌ์ฉ์๋ ๋ฌผํ์ ๋ฑ๋กํ ์ ์๋ค.
POST /api/products
param | type | required | description |
---|---|---|---|
category_id | body | true | ์นดํ ๊ณ ๋ฆฌ id(ex.1,2,3,4,5) |
title | body | true | ํ๋งค๊ธ ์ ๋ชฉ |
price | body | true | ๊ฐ๊ฒฉ |
description | body | true | ๋ฌผํ ์ค๋ช |
product_images | body | false | ์ ๋ก๋ ํ๊ณ ์ ํ๋ ํ์ผ๋ช (ํ์ฅ์๋ png, jpeg, jpg๋ง ๊ฐ๋ฅ, ์ต๋ ์ ๋ก๋ ๊ฐฏ์๋ 10๊ฐ) |
- ์ด๋ฏธ์ง ์์ด ๋ฑ๋กํ๋ ๊ฒฝ์ฐ
{
"category_id": 1,
"title": "๋งฅ๋ถ ํ๋๋ค",
"price": 9999,
"description": "๋ฏธ์ค๊ณ ๋งฅ๋ถ ํ๋๋ค"
}
- ์ด๋ฏธ์ง์ ํจ๊ป ๋ฑ๋กํ๋ ๊ฒฝ์ฐ
{
"category_id": 1,
"title": "๊ทธ๋จ ํ๋๋ค",
"price": 9999,
"description": "๋ฏธ์ค๊ณ ๊ทธ๋จ ํ๋๋ค",
"product_images": ["test001.jpg","test001.png","test003.jpeg"]
}
- ์ฑ๊ณต(200)
์ด๋ฏธ์ง ์์ด ๋ฑ๋กํ๋ ๊ฒฝ์ฐ
{
"product_id": 13,
"product_images": []
}
์ด๋ฏธ์ง์ ํจ๊ป ๋ฑ๋กํ๋ ๊ฒฝ์ฐ
{
"product_id": 13,
"product_images": [
"https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/e01f24b1-553f-4bc9-961d-15eb7401c5bctest001.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T152514Z&X-Amz-SignedHeaders=host%3Bx-amz-acl&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=4e4b7b3842e77e1be1fbee295d667585062ffac5ccbabf4ae9f2eee9b6c494aa",
"https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/00baf529-caf1-452d-b4a8-e1b74d1b92fftest002.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T152514Z&X-Amz-SignedHeaders=host%3Bx-amz-acl&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=53ff5c401770ae502b81e40ae86546709f14488ec29b4d36b19eb3a3c5c79ff1",
"https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/9362e993-f1fb-4e3f-b2dc-3630bc521b8dtest003.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T152514Z&X-Amz-SignedHeaders=host%3Bx-amz-acl&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=b16df75d1313d13398652cce6e84db2ee804a24028764b76cabe3d2e3a3f19f5"
]
}
- ์คํจ(400)
- ์ฌ์ฉ์๊ฐ ์์ ์ ์์น์ ๋๋ค์์ ๋ฑ๋กํ์ง ์๊ณ ๋ฌผํ์ ๋ฑ๋กํ ๊ฒฝ์ฐ
{
"message": "ํ๋งค์์ ์ฃผ์์ ๋๋ค์ ์ ๋ณด๋ ํ์์
๋๋ค.",
"status": 400,
"invalid_fields": null
}
- ํ๋งค์๋ ๋ฌผํ ์ ๋ณด๋ฅผ ์์ ํ ์ ์๋ค.
PUT /api/products/{product-id}
param | type | required | description |
---|---|---|---|
category_id | body | true | ์นดํ ๊ณ ๋ฆฌ id(ex.1,2,3,4,5) |
title | body | true | ํ๋งค๊ธ ์ ๋ชฉ |
price | body | true | ๊ฐ๊ฒฉ |
description | body | true | ๋ฌผํ ์ค๋ช |
{
"category_id": 1,
"title": "๋งฅ๋ถ ํ๋๋ค",
"price": 9999,
"description": "๋ฏธ์ค๊ณ ๋งฅ๋ถ ํ๋๋ค"
}
- ์ฑ๊ณต(200)
{
}
- ์คํจ(403)
- ํ๋งค์๊ฐ ์๋ ์ฌ์ฉ์๊ฐ ๋ฌผํ ์์ ์ ํ๋ ค๋ ๊ฒฝ์ฐ
{
"message": "Authority error (cause: ๋ฌผํ ์์ ์ ํ๋งค์๋ง ๊ฐ๋ฅํฉ๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ํ๋งค์๋ ๋ฌผํ ์ ๋ณด๋ฅผ ์ญ์ ํ ์ ์๋ค.
DELETE /api/products/{product-id}
- None
- ์ฑ๊ณต(200)
- ์คํจ(403)
{
"message": "Authority error (cause: ๋ฌผํ ์ญ์ ๋ ํ๋งค์๋ง ๊ฐ๋ฅํฉ๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ํ๋งค์๋ ๋ฌผํ ์ํ๋ฅผ ๋ณ๊ฒฝํ ์ ์๋ค.
PUT /api/products/state/{product-id}
param | type | required | description |
---|---|---|---|
state | body | true | ๋ฌผํ์ํ (ex.0-์จ๊ธฐ๊ธฐ,1-ํ๋งค์ค,2-๊ฑฐ๋์๋ฃ,3-์์ฝ์ค) |
buyer_id | body | false | ๊ตฌ๋งค์ user_id |
- ๋ฌผํ์ํ๋ฅผ '์จ๊ธฐ๊ธฐ', 'ํ๋งค์ค' ๋๋ '์์ฝ์ค'์ผ๋ก ๋ณ๊ฒฝํ๋ ๊ฒฝ์ฐ
{
"state": 3
}
- ๋ฌผํ์ํ๋ฅผ '๊ฑฐ๋์๋ฃ'๋ก ๋ณ๊ฒฝํ๋ ๊ฒฝ์ฐ
{
"state": 2,
"buyer_id": 1
}
- ์ฑ๊ณต(200)
{
}
- ์คํจ(400)
- ๋ฌผํ์ํ๋ฅผ '๊ฑฐ๋์๋ฃ'๋ก ๋ฐ๊ฟ ๋
buyerId
๋ฅผ ์ ๋ ฅํ์ง ์์ ๊ฒฝ์ฐ
- ๋ฌผํ์ํ๋ฅผ '๊ฑฐ๋์๋ฃ'๋ก ๋ฐ๊ฟ ๋
{
"message": "buyerId ๊ฐ์ ํ์์
๋๋ค.",
"status": 400,
"invalid_fields": null
}
- ์คํจ(403)
{
"message": "Authority error (cause: ๋ฌผํ ์ํ ๋ณ๊ฒฝ์ ํ๋งค์๋ง ๊ฐ๋ฅํฉ๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ํ๋งค์๋ ๋ฌผํ ๋์ด์ฌ๋ฆฌ๊ธฐ๋ฅผ ์ฌ์ฉํ ์ ์๋ค.
- 5ํ๊น์ง ์ฌ์ฉ๊ฐ๋ฅ
PUT /api/products/refreshment/{product-id}
- None
- ์ฑ๊ณต(200)
{
}
- ์คํจ(400)
- 5ํ ์ด์ ๋ฌผํ ๋์ด์ฌ๋ฆฌ๊ธฐ๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ
{
"message": "์๋ก ๊ณ ์นจ์ 5ํ์ด์ ํ ์ ์์ต๋๋ค.",
"status": 400,
"invalid_fields": null
}
- ์คํจ(403)
{
"message": "Authority error (cause: ๋ฌผํ ๋์ด์ฌ๋ฆฌ๊ธฐ๋ ํ๋งค์๋ง ๊ฐ๋ฅํฉ๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฌ์ฉ์๋ ์์ ์ ํ๋งค ๋ด์ญ ๋ฌผํ์ ์ํ๋ณ๋ก ์กฐํํ ์ ์๋ค.
GET /api/products/sales-history?state=0
GET /api/products/sales-history?state=1
GET /api/products/sales-history?state=2
param | type | required | description |
---|---|---|---|
state | query string | true | ๋ฌผํ์ํ(0-์จ๊ธฐ๊ธฐ, 1-ํ๋งค์ค,2-๊ฑฐ๋์๋ฃ) |
- ์ฑ๊ณต(200)
- ๋ฌผํ์ํ ์กฐํ ์กฐ๊ฑด์ด '๊ฑฐ๋์๋ฃ'์ธ ๊ฒฝ์ฐ
has_review
๊ฐ true์ผ ์ ์๋ค. - '๊ฑฐ๋์๋ฃ' ์ธ์ ๋ฌผํ ์ํ ์กฐํ ์กฐ๊ฑด์
has_review
๊ฐ ๋ฌด์กฐ๊ฑด false ์ด๋ค.
- ๋ฌผํ์ํ ์กฐํ ์กฐ๊ฑด์ด '๊ฑฐ๋์๋ฃ'์ธ ๊ฒฝ์ฐ
[
{
"id": 14,
"title": "๊ทธ๋จ ํ๋๋ค",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"price": 9999,
"thumb_nail_image": null,
"favorite_count": 3,
"chatting_count": 2,
"has_review": true,
"created_at": "2022-06-05T00:56:13.273674"
},
{
"id": 13,
"title": "๋งฅ๋ถ ํ๋๋ค",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"price": 9999,
"thumb_nail_image": "https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/7f10531b-bff3-4ac0-b185-4e89f820c764test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T155616Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=c9ead73ed5a3b41cb536148ff0f3a5f048ab68298368c2a43c7edd75ba0e887d",
"favorite_count": 0,
"chatting_count": 0,
"has_review": true,
"created_at": "2022-06-05T00:49:31.365339"
}
]
- ์ฌ์ฉ์๋ ์์ ์ ๊ตฌ๋งค ๋ด์ญ์ ์กฐํํ ์ ์๋ค.
GET /api/products/purchase-history
- None
- ์ฑ๊ณต(200)
[
{
"id": 14,
"seller_id": 2,
"title": "๊ทธ๋จ ํ๋๋ค",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"price": 9999,
"thumb_nail_image": null,
"favorite_count": 3,
"chatting_count": 2,
"has_review": true,
"created_at": "2022-06-05T00:56:13.273674"
},
{
"id": 13,
"seller_id": 2,
"title": "๋งฅ๋ถ ํ๋๋ค",
"location": "์์ธ์ ๊ฐ๋๊ตฌ",
"price": 9999,
"thumb_nail_image": "https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/7f10531b-bff3-4ac0-b185-4e89f820c764test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220604T155616Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220604%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=c9ead73ed5a3b41cb536148ff0f3a5f048ab68298368c2a43c7edd75ba0e887d",
"favorite_count": 0,
"chatting_count": 0,
"has_review": false,
"created_at": "2022-06-05T00:49:31.365339"
}
]
- ์ฌ์ฉ์๋ ์์ ์ด ์ฐํ ์ํ ๋ชฉ๋ก์ ์กฐํํ ์ ์๋ค.
GET /api/favorite-products
- None
- ์ฑ๊ณต(200)
[
{
"id": 3,
"title": "WH-1000XM4 ํ๋๋ค.",
"location": "์์ธํน๋ณ์ ๊ตฌ๋ก๊ตฌ ๊ตฌ๋ก๋",
"price": 350000,
"thumb_nail_image": "https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/c488cb78-fbc7-4527-b964-1594afa5e2e7WH_1.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220727T164512Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220727%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=966220682fd28eb16f6e09a5df5a6456f035ece11e20cd4819351aec778f3a13",
"favorite_count": 1,
"chatting_count": 0,
"created_at": "2022-07-27T17:08:57"
},
{
"id": 2,
"title": "์์ผํ๋ธ ํฐํธ๋ฆฌ ์ํฌ๋ค ๋ฐ์ผ๋ฆฌ ์์ ํ์์.",
"location": "์์ธํน๋ณ์ ๊ตฌ๋ก๊ตฌ ๊ตฌ๋ก๋",
"price": 12000,
"thumb_nail_image": "https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/a23ea5cf-bf7a-4282-b426-38ca313ae59a%E1%84%8B%E1%85%A6%E1%84%89%E1%85%A6%E1%86%AB%E1%84%89%E1%85%A7%E1%86%AF%E1%84%92%E1%85%A5%E1%84%87%E1%85%B3_1.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220727T164512Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220727%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=847c0131b37502fbd77f939be41bd99d9b763ee5e3be83c5e060c4998d4512a8",
"favorite_count": 2,
"chatting_count": 0,
"created_at": "2022-07-27T16:56:09"
},
{
"id": 4,
"title": "๋ด ํด๋ฆฐ์ค์ ์์ด ์ฒ๋ถํฉ๋๋ค~",
"location": "์์ธํน๋ณ์ ๊ตฌ๋ก๊ตฌ ๊ตฌ๋ก๋",
"price": 24000,
"thumb_nail_image": "https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/d9463672-abd6-4a92-8853-d283947d9761clean-swap_1.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220727T164512Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220727%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=342e57291ff30511c129cf029affe5b573d0e37181fd4e4ae2882730ddf74a74",
"favorite_count": 1,
"chatting_count": 0,
"created_at": "2022-07-27T17:13:14"
},
{
"id": 7,
"title": "์์ด์ปจ",
"location": "์์ธํน๋ณ์ ๊ตฌ๋ก๊ตฌ ๊ตฌ๋ก๋",
"price": 50000,
"thumb_nail_image": "https://BUCKET_NAME.s3.ap-northeast-2.amazonaws.com/product-image/c69c0660-b44f-43db-ab13-33376383ee48%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202022-07-27%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%205.20.59.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220727T164512Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220727%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=fdc1ee9bc49307632faaf90b220d9e5b7f8d00f2c6799cf390b15701f893c1b8",
"favorite_count": 1,
"chatting_count": 1,
"created_at": "2022-07-27T17:21:42"
}
]
- ์ฌ์ฉ์๋ ์ํ๋ ๋ฌผํ์ ์ฐํ ์ ์๋ค.
POST /api/favorite-products
param | type | required | description |
---|---|---|---|
product_id | body | true | ๋ฌผํ id |
{
"product_id": 1
}
- ์ฑ๊ณต(200)
{
"favorite_id": 8
}
- ์ฌ์ฉ์๋ ์์ ์ด ์ฐํ ๋ฌผํ์ ์ญ์ ํ ์ ์๋ค.
DELETE /api/favorite-products/{favorite-id}
- None
- ์ฑ๊ณต(200)
- ์คํจ(403)
{
"message": "Authority error (cause: ์ฐํ๊ธฐ๋ฅผ ๋๋ฅธ ๋ณธ์ธ๋ง ์ฐํ๊ธฐ๋ฅผ ์ญ์ ํ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฌ์ฉ์๋ ์์ ์ด ์ฐํ ๋ฌผํ์ ์ญ์ ํ ์ ์๋ค.
DELETE /api/favorite-products/products/{product-id}
- None
- ์ฑ๊ณต(200)
- ์ฌ์ฉ์๊ฐ ๋ฐ์ ์ ์ฒด ํ๊ธฐ๋ฅผ ์กฐํํ ์ ์๋ค.
GET /api/sale-reviews/user/{user-id}
- None
- ์ฑ๊ณต(200)
param | type | description |
---|---|---|
review_type | Integer | ๋ฆฌ๋ทฐ ํ์ (0: ํ๋งค์ ํ๊ธฐ, 1: ๊ตฌ๋งค ํ๊ธฐ) |
{
"id": 4,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ4",
"review_type": 0,
"created_at": "2022-06-17T14:29:35.481689"
},
{
"id": 3,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ3",
"review_type": 1,
"created_at": "2022-06-17T14:29:35.478303"
},
{
"id": 2,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ2",
"review_type": 0,
"created_at": "2022-06-17T14:29:35.475205"
},
{
"id": 1,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ1",
"review_type": 0,
"created_at": "2022-06-17T14:29:35.469625"
}
- ์ฌ์ฉ์๊ฐ ๋ฐ์ ํ๋งค์ ํ๊ธฐ๋ฅผ ์กฐํํ ์ ์๋ค.
GET /api/sale-reviews/seller/{user-id}
- None
- ์ฑ๊ณต(200)
param | type | description |
---|---|---|
review_type | Integer | ๋ฆฌ๋ทฐ ํ์ (0: ํ๋งค์ ํ๊ธฐ, 1: ๊ตฌ๋งค ํ๊ธฐ) |
{
"id": 4,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ4",
"review_type": 0,
"created_at": "2022-06-17T14:29:35.481689"
},
{
"id": 3,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ3",
"review_type": 0,
"created_at": "2022-06-17T14:29:35.478303"
},
{
"id": 2,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ2",
"review_type": 0,
"created_at": "2022-06-17T14:29:35.475205"
},
{
"id": 1,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ1",
"review_type": 0,
"created_at": "2022-06-17T14:29:35.469625"
}
- ๊ฑฐ๋ ์๋ฃํ ๊ตฌ๋งค์์ ๋ํ ํ๋งค์ ํ๊ธฐ๋ฅผ ๋จ๊ธธ ์ ์๋ค.
POST /api/sale-reviews/seller
param | type | required | description |
---|---|---|---|
product_id | body | true | ๋ฌผํ ID |
buyer_id | body | true | ๊ตฌ๋งค์ ID |
content | body | true | ํ๊ธฐ ๋ด์ฉ |
{
"product_id": 13,
"buyer_id": 1,
"content": "ํ๋งค์ ํ๊ธฐ์
๋๋ค."
}
- ์ฑ๊ณต(200)
{
"sale_review_id": 1
}
- ์คํจ(400)
{
"message": "๋ฆฌ๋ทฐ๋ฅผ ๋จ๊ธฐ๋ ์ฌ์ฉ์๋ ์ฃผ์์ ๋๋ค์์ด ํ์์
๋๋ค.",
"status": 400,
"invalid_fields": null
}
- ์คํจ(403)
{
"message": "Authority error (cause: ์ฌ๋ฐ๋ฅธ ์์ฒญ์ด ์๋๋๋ค. ์ค์ ํ๋งค์์ ๊ตฌ๋งค์๋ง ๋ฆฌ๋ทฐ๋ฅผ ๋จ๊ธธ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฌ์ฉ์๋ ์์ ์ด ์์ฑํ ํ๋งค์ ํ๊ธฐ๋ฅผ ์์ ํ ์ ์๋ค.
PUT /api/sale-reviews/seller/{sale-review-id}
param | type | required | description |
---|---|---|---|
content | body | true | ํ๊ธฐ ๋ด์ฉ |
{
"content": "ํ๋งค์ ํ๊ธฐ ์์ ์
๋๋ค."
}
- ์ฑ๊ณต(200)
- ์ฌ์ฉ์๋ ์์ ์ด ์์ฑํ ํ๋งค์ ํ๊ธฐ๋ฅผ ์ญ์ ํ ์ ์๋ค.
DELETE /api/sale-reviews/seller/{sale-review-id}
- None
- ์ฑ๊ณต(200)
- ์ฌ์ฉ์๊ฐ ๋ฐ์ ๊ตฌ๋งค์ ํ๊ธฐ๋ฅผ ์กฐํํ ์ ์๋ค.
GET /api/sale-reviews/buyer/{user-id}
- None
- ์ฑ๊ณต(200)
param | type | description |
---|---|---|
review_type | Integer | ๋ฆฌ๋ทฐ ํ์ (0: ํ๋งค์ ํ๊ธฐ, 1: ๊ตฌ๋งค ํ๊ธฐ) |
{
"id": 4,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ4",
"review_type": 1,
"created_at": "2022-06-17T14:29:35.481689"
},
{
"id": 3,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ3",
"review_type": 1,
"created_at": "2022-06-17T14:29:35.478303"
},
{
"id": 2,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ2",
"review_type": 1,
"created_at": "2022-06-17T14:29:35.475205"
},
{
"id": 1,
"reviewer_id": 1,
"reviewer": "ํ
์คํธ๋๋ค์1",
"profile_url": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"content": "ํ
์คํธ ๋ฆฌ๋ทฐ1",
"review_type": 1,
"created_at": "2022-06-17T14:29:35.469625"
}
- ๊ฑฐ๋ ์๋ฃํ ํ๋งค์์ ๋ํ ๊ตฌ๋งค์ ํ๊ธฐ๋ฅผ ๋จ๊ธธ ์ ์๋ค.
POST /api/sale-reviews/buyer
param | type | required | description |
---|---|---|---|
product_id | body | true | ๋ฌผํ ID |
seller_id | body | true | ํ๋งค์ ID |
content | body | true | ํ๊ธฐ ๋ด์ฉ |
{
"product_id": 3,
"seller_id": 1,
"content": "๊ตฌ๋งค์ ํ๊ธฐ"
}
- ์ฑ๊ณต(200)
{
"sale_review_id": 5
}
- ์คํจ(400)
{
"message": "๋ฆฌ๋ทฐ๋ฅผ ๋จ๊ธฐ๋ ์ฌ์ฉ์๋ ์ฃผ์์ ๋๋ค์์ด ํ์์
๋๋ค.",
"status": 400,
"invalid_fields": null
}
- ์คํจ(403)
{
"message": "Authority error (cause: ์ฌ๋ฐ๋ฅธ ์์ฒญ์ด ์๋๋๋ค. ์ค์ ํ๋งค์์ ๊ตฌ๋งค์๋ง ๋ฆฌ๋ทฐ๋ฅผ ๋จ๊ธธ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฌ์ฉ์๋ ์์ ์ด ์์ฑํ ๊ตฌ๋งค์ ํ๊ธฐ๋ฅผ ์์ ํ ์ ์๋ค.
PUT /api/sale-reviews/buyer/{sale-review-id}
param | type | required | description |
---|---|---|---|
content | body | true | ํ๊ธฐ ๋ด์ฉ |
{
"content": "๊ตฌ๋งค์ ํ๊ธฐ ์์ ์
๋๋ค."
}
- ์ฑ๊ณต(200)
- ์ฌ์ฉ์๋ ์์ ์ด ์์ฑํ ๊ตฌ๋งค์ ํ๊ธฐ๋ฅผ ์ญ์ ํ ์ ์๋ค.
DELETE /api/sale-reviews/buyer/{sale-review-id}
- None
- ์ฑ๊ณต(200)
- ์ฌ์ฉ์๋ ์์ ์ด ๋ฐ์ ๋ฆฌ๋ทฐ๋ฅผ ์จ๊ธธ ์ ์๋ค.
PUT /api/sale-reviews/hide/{sale-review-id}
- None
- ์ฑ๊ณต(200)
- ์คํจ(403)
{
"message": "Authority error (cause: ๋ฆฌ๋ทฐ๋ฅผ ๋ฐ์ ์ฌ๋๋ง ๋ฐ์ ๋ฆฌ๋ทฐ๋ฅผ ์จ๊ธธ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฌ์ฉ์๋ ์์ ์๊ฒ ์จ ์๋ฆผ ๋ชฉ๋ก์ ์กฐํํ ์ ์๋ค.
GET /api/notifications
- None
- ์ฑ๊ณต(200)
- ๋ฌผํ ๊ด๋ จ ํญ๋ชฉ์ธ
product_id
,price
,title
,thumb_nail_image
๊ณผ ๋ฆฌ๋ทฐ ๋จ๊ธด ์ฌ์ฉ์ ํญ๋ชฉ์ธreviewer_id
,nickname
,profile_url
์ ๋์์ ๋ํ๋์ง ์๋๋ค. ํ ์ชฝ ํ๋๊ฐ ์ฑ์์ ธ์๋ ๊ฒฝ์ฐ ๋๋จธ์ง ํ๋๋ null- ์๋ฆผ ์ ํ์ด 0์ธ ๊ฒฝ์ฐ,
price
,reviewer_id
,nickname
,profile_url
์ด null - ์๋ฆผ ์ ํ์ด 1์ธ ๊ฒฝ์ฐ,
reviewer_id
,nickname
,profile_url
์ด null - ์๋ฆผ ์ ํ์ด 2์ธ ๊ฒฝ์ฐ,
price
๊ฐ null - ์๋ฆผ ์ ํ์ด 3์ธ ๊ฒฝ์ฐ,
product_id
,price
,title
,thumb_nail_image
๋ null
- ์๋ฆผ ์ ํ์ด 0์ธ ๊ฒฝ์ฐ,
- ์ถ๊ฐ๋ก ์๋ฆผ ์ ํ 0,1,2 ์ค์ ์๋ฆผ ์ ํ 2์์๋ง
price
ํญ๋ชฉ์ ์ฌ์ฉํ๋ค.
field_name | description |
---|---|
id | ์๋ฆผ ID |
noti_code | ์๋ฆผ ์ ํ์ ํด๋นํ๋ int ์ฝ๋(0-์ฐํ ์ํ์ด ๊ฑฐ๋ ์๋ฃ๋ ๊ฒฝ์ฐ, 1-์ฐํ ์ํ์ ๊ฐ๊ฒฉ์ด ๋ฎ์์ง ๊ฒฝ์ฐ, 2-ํ๋งค์๊ฐ ํ๋งค์๋ฃ๋ก ์ํ๋ฅผ ๋ณ๊ฒฝํ ๊ฒฝ์ฐ, 3-๊ตฌ๋งค์๊ฐ ๊ตฌ๋งคํ๊ธฐ๋ฅผ ๋จ๊ธด ๊ฒฝ์ฐ) |
noti_type | ์์ ์๋ฆผ ์ ํ ์ฝ๋์ ํด๋นํ๋ String |
product_id | ๋ฌผํ id (์๋ฆผ ์ ํ 0,1,2์์ ์ฌ์ฉ๋๋ค.) |
price | ๋ฌผํ ๊ฐ๊ฒฉ (์๋ฆผ ์ ํ 1์์๋ง ์ฌ์ฉ๋๋ค.) |
title | ๋ฌผํ ํ๋งค๊ธ ์ ๋ชฉ (์๋ฆผ ์ ํ 0,1,2์์ ์ฌ์ฉ๋๋ค.) |
thumb_nail_image | ๋ฌผํ ์ธ๋ค์ผ ์ด๋ฏธ์ง URL (์๋ฆผ ์ ํ 0,1,2์์ ์ฌ์ฉ๋๋ค.) |
reviewer_id | ๋ฆฌ๋ทฐ๋ฅผ ๋จ๊ธด ์ฌ์ฉ์ ID (์๋ฆผ ์ ํ 2, 3์์ ์ฌ์ฉ๋๋ค.) |
nickname | ๋ฆฌ๋ทฐ๋ฅผ ๋จ๊ธด ์ฌ์ฉ์์ ๋๋ค์ (์๋ฆผ ์ ํ 2, 3์์ ์ฌ์ฉ๋๋ค.) |
profile_url | ์ฌ์ฉ์์ ํ๋กํ์ ํด๋นํ๋ ์ด๋ฏธ์ง URL (์๋ฆผ ์ ํ 2, 3์์ ์ฌ์ฉ๋๋ค.) |
created_at | ์๋ฆผ์์ฑ ์ผ์ |
view | ํด๋น ์๋ฆผ ์กฐํ ์ฌ๋ถ๋ฅผ ๋ํ๋ธ๋ค. |
[
{
"id": 5,
"noti_code": 3,
"noti_type": "๊ตฌ๋งคํ๊ธฐ๋ฅผ ๋จ๊ธด ๊ฒฝ์ฐ",
"product_id": null,
"price": null,
"title": null,
"thumb_nail_image": null,
"reviewer_id": 2,
"nickname": "ํ
์คํธ ๋๋ค์1",
"profile_url": "https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/profile-image/test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220628T075436Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220628%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=cdb5b5d42ad3e2323efe94bb1b336932c06e2583cb38165a49a5c342521a1215",
"created_at": "2022-06-28T16:51:56.748767",
"view": true
},
{
"id": 6,
"noti_code": 2,
"noti_type": "ํ๋งค์๊ฐ ํ๋งค์๋ฃ๋ก ์ํ๋ฅผ ๋ณ๊ฒฝํ ๊ฒฝ์ฐ",
"product_id": 4,
"price": null,
"title": "mockProduct ํ๋๋ค3",
"thumb_nail_image": null,
"reviewer_id": 2,
"nickname": "์ด์ฌํ",
"profile_url": "https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/profile-image/1c50fadb-76db-4892-8d71-6ef517a1dd71img_110x110.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220725T154513Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220725%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=e4b041b043445e14937e8a7715fbc532859644ae11800f83a1fa1e233c5498dc",
"created_at": "2022-07-25T10:21:54",
"view": false
},
{
"id": 2,
"noti_code": 0,
"noti_type": "์ฐํ ์ํ์ด ๊ฑฐ๋ ์๋ฃ๋ ๊ฒฝ์ฐ",
"product_id": 1,
"price": null,
"title": "mockProduct ํ๋๋ค3",
"thumb_nail_image": "https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/product-image/82c55a67-400f-4bef-8066-ecb65cd86582test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220628T075436Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220628%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=33dccbbc28f390025049ee10b697b28b11b8489f46154c52579d1a348f1fd312",
"reviewer_id": null,
"nickname": null,
"profile_url": null,
"created_at": "2022-06-28T16:50:44.333321",
"view": false
},
{
"id": 1,
"noti_code": 1,
"noti_type": "์ฐํ ์ํ์ ๊ฐ๊ฒฉ์ด ๋ฎ์์ง ๊ฒฝ์ฐ",
"product_id": 1,
"price": 20000,
"title": "mockProduct ํ๋๋ค3",
"thumb_nail_image": "https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/product-image/82c55a67-400f-4bef-8066-ecb65cd86582test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220628T075436Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220628%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=33dccbbc28f390025049ee10b697b28b11b8489f46154c52579d1a348f1fd312",
"reviewer_id": null,
"nickname": null,
"profile_url": null,
"created_at": "2022-06-28T16:49:52.600271",
"view": false
}
]
- ์ฌ์ฉ์๋ '์ฝ์ง ์์' ์ํ์๋ ์๋ฆผ์ '์ฝ์' ์ํ๋ก ๋ฐ๊ฟ ์ ์๋ค.
PUT /api/notifications/{notification-id}
- None
- ์ฑ๊ณต(200)
{
}
- ์คํจ(403)
- ์์ ์ด ๋ฐ์ ์๋ฆผ์ด ์๋๋ฐ ์ฝ์ ์ฒ๋ฆฌ๋ฅผ ์๋ํ ๊ฒฝ์ฐ
{
"message": "Authority error (cause: ๋ณธ์ธ์ด ๋ฐ์ ์๋ฆผ๋ง ์ฝ์ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฌ์ฉ์๋ ์์ ์ด ๋ฐ์ ์๋ฆผ์ ์ญ์ ํ ์ ์๋ค.
DELETE /api/notifications/{notification-id}
- None
- ์ฑ๊ณต(200)
{
}
- ์คํจ(403)
- ์์ ์ด ๋ฐ์ ์๋ฆผ์ด ์๋๋ฐ ์ญ์ ์ฒ๋ฆฌ๋ฅผ ์๋ํ ๊ฒฝ์ฐ
{
"message": "Authority error (cause: ๋ณธ์ธ์ด ๋ฐ์ ์๋ฆผ๋ง ์ญ์ ํ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฌ์ฉ์๋ ์ํ๋ ๋ฌผํ์ ๋ํด ์ฑํ ๋ฐฉ์ ์์ฑํ ์ ์๋ค.
POST /api/chat-rooms
param | type | required | description |
---|---|---|---|
product_id | body | true | ๋ฌผํ id |
other_user_id | body | true | ์๋๋ฐฉ ID |
{
"product_id": 5,
"other_user_id": 1
}
- ์ฑ๊ณต(200)
{
"room_id": "62a992369d47a67cf5aaca76"
}
- ์ฌ์ฉ์๋ ์์ ์ด ์ฐธ์ฌ์ค์ธ ์ฑํ ๋ฐฉ ๋ชฉ๋ก์ ์กฐํํ ์ ์๋ค.
- ํ์ด์ง ๊ฐ๋ฅ / ์ต๋ 10๊ฐ๊น์ง ์กฐํ
GET /api/chat-rooms
- None
- ์ฑ๊ณต(200)
field_name | description |
---|---|
chat_room_id | ์ฑํ ๋ฃธ ID |
participant | ์ฑํ ์๋๋ฐฉ ๋๋ค์ |
participant_image | ์ฑํ ์๋๋ฐฉ ํ๋กํ ์ด๋ฏธ์ง URL (์กด์ฌํ์ง ์์ ์ null) |
location | ์ฑํ ์๋๋ฐฉ์ด ์ฌ๋ ์ฃผ์ |
product_image | ๋ฌผํ ์ด๋ฏธ์ง URL (์กด์ฌํ์ง ์์ ์ null) |
last_chat | ํ์ฌ ์ฑํ ๋ฐฉ์ ์๋ ๊ฐ์ฅ ์ต์ ๋ฉ์์ง |
not_read_chat_count | ํ์ฌ ์ฌ์ฉ์๊ฐ ์ฝ์ง ์์ ๋ฉ์์ง ๊ฐฏ์ |
page_offset | '์ฑํ
๋ฐฉ ๋ฉ์์ง ๋ชฉ๋ก ์กฐํ API' ์ฌ์ฉ ์ ํ์ด์ง ์์ํ๋ ์์น. ์๋ก ์คํฌ๋กค ํ ๋ ๋ง๋ค page_offset - page_size ๋ก offset์ ๋ณ๊ฒฝํ๋ฉฐ ์ฌ์์ฒญํ๋ฉด ๋๋ค. |
page_size | ํ ๋ฒ์ ์ฑํ ๋ฉ์์ง ๋ถ๋ฌ์ค๋ ๊ฐฏ์ |
updated_at | ์ฑํ ๋ฐฉ ์์ ์ผ์ |
[
{
"chat_room_id": "62a992369d47a67cf5aaca76",
"participant": "ํ
์คํธ๋๋ค์1",
"participant_image": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"product_image": null,
"last_chat": null,
"not_read_chat_count": 0,
"page_offset": 0,
"page_size": 10,
"updated_at": "2022-06-15T17:03:02.402"
},
{
"chat_room_id": "62a980ec794e3f5281741e82",
"participant": "ํ
์คํธ๋๋ค์5",
"participant_image": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"product_image": null,
"last_chat": "๋ฉ์์ง + 9",
"not_read_chat_count": 10,
"page_offset": 0,
"page_size": 10,
"updated_at": "2022-06-15T15:49:16.074"
},
{
"chat_room_id": "62a980ec794e3f5281741e7f",
"participant": "ํ
์คํธ๋๋ค์4",
"participant_image": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"product_image": null,
"last_chat": null,
"not_read_chat_count": 0,
"page_offset": 0,
"page_size": 10,
"updated_at": "2022-06-15T15:49:16.041"
},
{
"chat_room_id": "62a980ec794e3f5281741e7c",
"participant": "ํ
์คํธ๋๋ค์3",
"participant_image": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"product_image": "https://project-club-bucket.s3.ap-northeast-2.amazonaws.com/product-image/5d329b04-ca13-4f0c-bdc9-4af74c457d55test001.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220615T105303Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220615%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=8705ef1e02d6326eb5dbaf57ea1a2b78e3f94158838b5a8b670a5cbe3c77d719",
"last_chat": null,
"not_read_chat_count": 0,
"page_offset": 0,
"page_size": 10,
"updated_at": "2022-06-15T15:49:16.008"
},
{
"chat_room_id": "62a980eb794e3f5281741e79",
"participant": "ํ
์คํธ๋๋ค์2",
"participant_image": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"product_image": null,
"last_chat": null,
"not_read_chat_count": 0,
"page_offset": 0,
"page_size": 10,
"updated_at": "2022-06-15T15:49:15.977"
},
{
"chat_room_id": "62a980eb794e3f5281741e76",
"participant": "ํ
์คํธ๋๋ค์1",
"participant_image": null,
"location": "๋
ธ์๊ตฌ ์๊ณ๋",
"product_image": null,
"last_chat": null,
"not_read_chat_count": 0,
"page_offset": 0,
"page_size": 10,
"updated_at": "2022-06-15T15:49:15.904"
}
]
- ์ฌ์ฉ์๋ ์ฑํ ๋ฐฉ ์์ธ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์๋ค.
GET /api/chat-rooms/{chat-room-id}
- None
- ์ฑ๊ณต(200)
field_name | description |
---|---|
chat_room_id | ์ฑํ ๋ฃธ ID |
participant_id | ์ฑํ ์๋๋ฐฉ(์ดํ ์๋๋ฐฉ) ID |
participant_nickname | ์๋๋ฐฉ ๋๋ค์ |
participant_manner | ์๋๋ฐฉ ๋งค๋์จ๋ |
participant_image | ์๋๋ฐฉ ํ๋กํ ์ด๋ฏธ์ง URL (์กด์ฌํ์ง ์์ ์ null) |
out | ์๋๋ฐฉ์ด ํ์ฌ ์ฑํ ๋ฐฉ์ ๋๊ฐ๋์ง ์ฌ๋ถ |
product_id | ๋ฌผํ ID |
product_image | ๋ฌผํ ์ด๋ฏธ์ง URL (์กด์ฌํ์ง ์์ ์ null) |
product_price | ๋ฌผํ ๊ฐ๊ฒฉ |
product_title | ๋ฌผํ ์ ๋ชฉ |
product_name | ๋ฌผํ ์ด๋ฆ |
product_state | ๋ฌผํ ์ํ |
{
"chat_room_id": "62a980eb794e3f5281741e76",
"participant_id": 1,
"participant_nickname": "ํ
์คํธ๋๋ค์1",
"participant_manner": 36.5,
"participant_image": null,
"out": false,
"product_id": 1,
"product_image": null,
"product_price": 10000,
"product_title": "mockProduct ํ๋๋ค1",
"product_name": "mockProduct1",
"product_state": "ํ๋งค์ค"
}
- ์คํจ(403)
- ์์ ์ด ์ฐธ์ฌํ๊ณ ์์ง ์์ ์ฑํ ๋ฐฉ์ ์กฐํํ๋ ๊ฒฝ์ฐ
{
"message": "Authority error (cause: ์ฑํ
๋ฐฉ ์ฐธ์ฌ์๋ง ์ฑํ
๋ฐฉ ์์ธ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์์ ์ด ํ๋งค์ค์ธ ์ํ์ ๋ํด ์ฑํ ๋ฐฉ์ ์ฐธ์ฌ์ค์ธ ๊ตฌ๋งค์ ๋ชฉ๋ก์ ์กฐํํ ์ ์๋ค.
GET /api/chat-rooms/product/{product-id}
- None
- ์ฑ๊ณต(200)
[
{
"id": 1,
"name": "ํ
์คํธ ๋๋ค์1"
},
{
"id": 2,
"name": "ํ
์คํธ๋๋ค์2"
},
{
"id": 3,
"name": "ํ
์คํธ๋๋ค์4"
},
{
"id": 4,
"name": "ํ
์คํธ๋๋ค์3"
},
{
"id": 5,
"name": "ํ
์คํธ๋๋ค์5"
}
]
- ์คํจ(403)
- ์์ ์ด ํ๋งค์ค์ธ ์ํ์ด ์๋ product์ ๋ํด ์กฐํํ๋ ๊ฒฝ์ฐ
{
"message": "Authority error (cause: ๋ฌผํ ํ๋งค์๋ง ๊ตฌ๋งค์ ์ฑํ
๋ฐฉ ๋ชฉ๋ก์ ์กฐํํ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฑํ ๋ฐฉ์ ๋๊ฐ ์๋๋ฐฉ์ ๋ค์ ์ด๋ํ ์ ์๋ค.
PUT /chat/chat-rooms/invitation/{chat-room-id}
param | type | required | description |
---|---|---|---|
user_id | body | true | ์ด๋ํ๋ ค๋ ์ฌ์ฉ์ ID |
{
"user_id": 1
}
- ์ฑ๊ณต(200)
{
}
- ์คํจ(400)
{
"message": "์๊ธฐ ์์ ์ ์ด๋ํ ์ ์์ต๋๋ค.",
"status": 400,
"invalid_fields": null
}
- ์คํจ(403)
- ์์ ์ด ์ฐธ์ฌํ๊ณ ์์ง ์์ ์ฑํ ๋ฐฉ์ ๋ํด API๋ฅผ ํธ์ถํ๋ ๊ฒฝ์ฐ
- ์ฑํ ๋ฐฉ์ ์ฐธ์ฌํ๊ณ ์์ง ์๋ ์๋๋ฐฉ์ ์ด๋ํ๋ ๊ฒฝ์ฐ
{
"message": "Authority error (cause: ์ฑํ
๋ฐฉ ์ฐธ์ฌ์๋ง ์ฑํ
๋ฐฉ์ ์ด๋ํ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฑํ ๋ฐฉ์ ๋๊ฐ ์ ์๋ค.
PUT /chat/chat-rooms/exit/{chat-room-id}
- None
- ์ฑ๊ณต(200)
{
}
- ์คํจ(403)
- ์์ ์ด ์ฐธ์ฌํ๊ณ ์์ง ์์ ์ฑํ ๋ฐฉ์ ๋ํด API๋ฅผ ํธ์ถํ๋ ๊ฒฝ์ฐ
{
"message": "Authority error (cause: ์ฑํ
๋ฐฉ ์ฐธ์ฌ์๋ง ์ฑํ
๋ฐฉ ๋๊ฐ๊ธฐ๋ฅผ ํ ์ ์์ต๋๋ค.)",
"status": 403,
"invalid_fields": null
}
- ์ฑํ
๋ฐฉ์ ๋ฉ์์ง๋ฅผ ๋ณด๋ผ ์ด๋ฏธ์ง์ ๋ํ
presigned-url
์ ๋ฏธ๋ฆฌ ์์ฑํ ์ ์๋ค.
POST /chat/messages/images
param | type | required | description |
---|---|---|---|
img_files | body | true | ๋ฑ๋กํ๊ณ ์ ํ๋ ์ด๋ฏธ์ง ํ์ผ๋ช ๋ฐฐ์ด. ์ต๋ 10๊ฐ๋ง ๊ฐ๋ฅ .png, .jpeg, .jpg๋ก ๋๋๋ ๋ฐ์ดํฐ๋ง ๊ฐ๋ฅ |
{
"img_files": ["test1.jpg", "test2.png", "test3.jpg", "ํ์ด.jpg", "๋ฐ์ด.png"]
}
field_name | description |
---|---|
origin_name | request body๋ก ๋ณด๋๋ ํ์ผ๋ช ์ ํด๋นํ๋ค. |
image_name | presigned_url์ ์จ์ ์ฑํ
์ด๋ฏธ์ง ์์ฑ์ดํ , ์ด๋ฏธ์ง๋ฅผ ์ฑํ
๋ฉ์์ง ๋ณด๋ด๊ธฐ API๋ฅผ ์จ์ ์ฑํ
๋ฉ์์ง๋ก ๋ณด๋ผ ๋ ์ฌ์ฉํ๋ค. |
image_name ์ด ๊ฐ์ ์ฌ์ฉํด์ message_type์ 3 , message์ image_name ์ ๋ฃ์ผ๋ฉด ๋๋ค. |
|
presigned_url | ๋ฐ๊ธ๋ฐ์ ์ด ๊ฐ์ ์ฌ์ฉํด์ ํด๋น ํ์ผ์ ๋ฒํท ์ ์ฅ์์ ๋ฑ๋กํ๋ฉด ๋๋ค. |
- ์ฑ๊ณต(200)
{
"origin_name": "test1.jpg",
"image_name": "15785614-e0e9-4d4f-97aa-9a09abb05a6dtest1.jpg",
"presigned_url": "https://project-club-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/15785614-e0e9-4d4f-97aa-9a09abb05a6dtest1.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220626T084527Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220626%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=20efb322e9ae20ccc939afd1f9e18352266b1d449d7b123b1c16ad84f5f0c924"
},
{
"origin_name": "test2.png",
"image_name": "9bda2650-8928-4ea1-bf8f-7e17e6412f64test2.png",
"presigned_url": "https://project-club-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/9bda2650-8928-4ea1-bf8f-7e17e6412f64test2.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220626T084527Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220626%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=93ed08a46193cd5b79aab72d130bf14795b4774145136bb2ceb20f01817f0925"
},
{
"origin_name": "test3.jpg",
"image_name": "9ccf6567-f491-433f-97e4-69cb0a5f5a8atest3.jpg",
"presigned_url": "https://project-club-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/9ccf6567-f491-433f-97e4-69cb0a5f5a8atest3.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220626T084527Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220626%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=ffb57aa75280c04e78d3ca0006e2e16cda7babfc00a2ca143506b52cacd342fb"
},
{
"origin_name": "ํ์ด.jpg",
"image_name": "fa23c269-d12f-46dc-9832-aed32bd88b0eํ์ด.jpg",
"presigned_url": "https://project-club-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/fa23c269-d12f-46dc-9832-aed32bd88b0e%ED%95%98%EC%9D%B4.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220626T084527Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220626%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=ae9d5c9f449d52d79c9b1bbfec49440e463bd24b141be316cd650753fc2fd41d"
},
{
"origin_name": "๋ฐ์ด.png",
"image_name": "6d9c09b1-5feb-4d91-ab70-d41ac63c2383๋ฐ์ด.png",
"presigned_url": "https://project-club-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/6d9c09b1-5feb-4d91-ab70-d41ac63c2383%EB%B0%94%EC%9D%B4.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220626T084527Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA45U7IOW6L%2F20220626%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=7e989666ef6c07ca086b121fdda7aaa34435ddc0b3d773a3ac8ae419ff913d04"
}
- ์คํจ(400)
- ์ฌ๋ฐ๋ฅด์ง ์์ ๋ฐ์ดํฐ ํ์ (์ขํ,์ด๋ฏธ์ง ๋ฉ์์ง๋ง ํด๋น)
- ์ฑํ ๋ฉ์์ง๋ฅผ ๋ณด๋ผ ์ ์๋ค.
POST /chat/messages
param | type | required | description |
---|---|---|---|
room_id | body | true | ์ฑํ ๋ฃธ ID |
sender_id | body | true | ์ก์ ์ ID |
receiver_id | body | true | ์์ ์ ID |
message_type | body | true | ๋ฉ์์ง ํ์ (1.์ผ๋ฐ๋ฉ์์ง, 2.์ขํ ๋ฉ์์ง, 3.์ด๋ฏธ์ง ๋ฉ์์ง |
message | body | false | ๋ฉ์์ง ๋ด์ฉ(๋ฉ์์ง ํ์ 1,2์ธ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํ๋ ํ๋) |
img_files | body(ARRAY) | false | ์ ์กํ ์ด๋ฏธ์ง ๋ฆฌ์คํธ(๋ฉ์์ง ํ์ 3์ธ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํ๋ ํ๋) |
- message_type ๋ณด์ถฉ ์ค๋ช
- ์ผ๋ฐ ๋ฉ์์ง: null, ๊ณต๋ฐฑ๋ฌธ์, ๋น ๋ฌธ์๋ฅผ ์ ์ธํ๊ณ ๋ ๋ค๋ฅธ ์ ์ฝ ์ฌํญ X
- ์ขํ ๋ฉ์์ง:
"X,Y"
ํํ๋ก comma ํ๋๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ ๊ฐ์ ์ขํ ๊ฐ์ด ๋ค์ด์์ผ ํ๋ค. - ์ด๋ฏธ์ง ๋ฉ์์ง:
.png
,.jpeg
,.jpg
๋ก ๋๋๋ ๋ฐ์ดํฐ๋ง ๊ฐ๋ฅ. ์ด์ ์ ์ฑํ ์ด๋ฏธ์ง ์์ฑ API๋ฅผ ํตํด ์ด๋ฏธ์ง๋ฅผ presignedUrl์ ๋ฑ๋กํ๊ณimage_name
์ผ๋ก ๋ฐ์ ๊ฐ์ ๋ฃ์ด์ค์ผ ํ๋ค.
- message, img_files ๋ณด์ถฉ ์ค๋ช
- message, img_files ๋ ํ๋๋
๋์์ ์ฌ์ฉํ ์ ์๋ค
. ๋ฉ์์ง ํ์ ์ ๋ง๋ ํ ํ๋๋ง ์ฌ์ฉํด์ผ ํ๋ค.
- message, img_files ๋ ํ๋๋
- ์ผ๋ฐ ๋ฉ์์ง์ธ ๊ฒฝ์ฐ
- message_type: 1
{
"room_id": "62aa118d9de1944f4671f808",
"sender_id":6,
"receiver_id": 1,
"message_type":1,
"message":"ํ
์คํธ ๋ฉ์์ง ์
๋๋ค"
}
- ์ขํ ๋ฐ์ดํฐ์ธ ๊ฒฝ์ฐ (X,Y)
- message_type: 2
{
"room_id": "62b8266645dc3e3c3c4d9c31",
"sender_id":6,
"receiver_id": 1,
"message_type": 2,
"message":"1123,2123"
}
- ์ด๋ฏธ์ง ๋ฐ์ดํฐ์ธ ๊ฒฝ์ฐ
- message_type: 3
{
"room_id": "62b96d2844b3907e8fb28a2d",
"sender_id":6,
"receiver_id": 1,
"message_type":3,
"img_files": ["c16de0a7-0c8c-44fb-a87e-8a7afe4fbb27test1.jpg","fc0a2cf6-2c88-4fae-bf1b-0f96481606dftest2.png","6b06d600-52a8-40f1-a328-4f6cb3df615dtest3.jpg","3d6e58d2-ff68-40e0-81f0-c5df4c2aeb37ํ์ด.jpg","21debba4-d5a5-4f4a-a9a9-4c17bbab4ce5๋ฐ์ด.png"]
}
- ์ฑ๊ณต(200)
{
}
- ์คํจ(400)
- ์ฌ๋ฐ๋ฅด์ง ์์ ๋ฐ์ดํฐ ํ์ (์ขํ,์ด๋ฏธ์ง ๋ฉ์์ง๋ง ํด๋น)
{
"message": "java.lang.IllegalArgumentException: ์ฌ๋ฐ๋ฅธ ์ด๋ฏธ์ง ๋ฐ์ดํฐ ํ์์ด ์๋๋๋ค.",
"status": 400,
"invalid_fields": null
}
{
"message": "java.lang.IllegalArgumentException: ์ฌ๋ฐ๋ฅธ ์ขํ ๋ฉ์์ง ํ์์ด ์๋๋๋ค.",
"status": 400,
"invalid_fields": null
}
- ํน์ ์ฑํ
๋ฐฉ ๋ด ๋ฉ์์ง๋ค์ ์กฐํํ ์ ์๋ค.
- ์ฑํ ๋ฐฉ ๋ด ๋ฉ์์ง๋ค์ DB์ ์ ์ฅ๋ index๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ด๋ฆผ์ฐจ์ ์กฐํ
- ํ์ด์ง ์ฌ์ด์ฆ: 10(๋ฉ์์ง๋ 10๊ฐ์ฉ ๊ฐ์ ธ์ด)
- ํ์ด์ง ์ต์๊ฐ์ 0(๊ฐ์ฅ ์์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ง๊ณ ์ค๊ณ ์ถ์ ๊ฒฝ์ฐ)
GET /chat/messages?room_id=62a040c660c94648d2115371&page=50
GET /chat/messages?room_id=62a040c660c94648d2115371&page=40
GET /chat/messages?room_id=62a040c660c94648d2115371&page=30
GET /chat/messages?room_id=62a040c660c94648d2115371&page=20
GET /chat/messages?room_id=62a040c660c94648d2115371&page=10
GET /chat/messages?room_id=62a040c660c94648d2115371&page=0
param | type | required | description |
---|---|---|---|
room_id | query string | true | ์ฑํ ๋ฐฉ ID |
page | query string | true | ์ฑํ
๋ฐฉ ๋ด ์ต์ ๋ฉ์์ง๋ถํฐ ๊ฐ์ ธ์ค๊ธฐ ์ํ offset. '์ฑํ
๋ฐฉ ๋ชฉ๋ก ์กฐํ' API ๊ฒฐ๊ณผ์ค์ page_offset ๋ฅผ ์ด๊ธฐ๊ฐ์ผ๋ก ์ฌ์ฉํ๋ฉด ๋๋ค. |
field_name | description |
---|---|
sender_id | ์ฑํ ๋ฉ์์ง๋ฅผ ๋ณด๋ธ ์ ์ ID |
message_type | ์ฑํ ๋ฉ์์ง ํ์ . ์ฑํ ๋ฉ์์ง ๋ณด๋ด๊ธฐ API์ ์ ์ํ ๋ด์ฉ๊ณผ ์ผ์นํ๋ค. |
message | ์ฑํ ๋ฐฉ ๋ฉ์์ง ํ์ 1,2(์ผ๋ฐ ๋ฉ์์ง, ์ขํ ๋ฉ์์ง)์ธ ๊ฒฝ์ฐ์๋ง ๋ค์ด์๋ ํ๋. ์ด๋ฏธ์ง ํ์ ์ผ ๋ null์ ๋ฐํ |
img_urls | ์ฑํ ๋ฐฉ ๋ฉ์์ง ํ์ 3(์ด๋ฏธ์ง ๋ฉ์์ง)์ธ ๊ฒฝ์ฐ์๋ง ๋ค์ด์๋ ํ๋. ๋ฐฐ์ด๋ก ๋ค์ด์๊ณ , ๋ค๋ฅธ ํ์ ์ผ ๋ null์ ๋ฐํ |
created_at | ๋ฉ์์ง ์์ฑ์ผ์ |
- ์ฑ๊ณต(200)
[
{
"sender_id": 6,
"message_type": 2,
"message": "123, 456",
"img_urls": null,
"created_at": "2022-06-27T18:17:13.608"
},
{
"sender_id": 6,
"message_type": 2,
"message": "123,456",
"img_urls": null,
"created_at": "2022-06-27T18:17:11.112"
},
{
"sender_id": 6,
"message_type": 1,
"message": "normal message normal message normal message normal message normal message",
"img_urls": null,
"created_at": "2022-06-27T18:09:41.338"
},
{
"sender_id": 6,
"message_type": 3,
"message": null,
"img_urls": [
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/c16de0a7-0c8c-44fb-a87e-8a7afe4fbb27test1.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=2f747a45f9746911dd6c4a5d89357b1e5eea89567fe00d06eb3b5af998cf9402",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/fc0a2cf6-2c88-4fae-bf1b-0f96481606dftest2.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=ea45266547947eccefc1189891db66f4f5ba1a5e706f061b8eec11e2fc0321cc",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/6b06d600-52a8-40f1-a328-4f6cb3df615dtest3.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=011c1768a8a38df485be5af76ea59f5f672202040392fde31df27fb7fbefa024",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/3d6e58d2-ff68-40e0-81f0-c5df4c2aeb37%ED%95%98%EC%9D%B4.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=2bc9a4bd7188ac34ab1a6960b26763f5398c88533f45d8666607c97152c52b9a",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/21debba4-d5a5-4f4a-a9a9-4c17bbab4ce5%EB%B0%94%EC%9D%B4.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=e81f87f87383f29af6f51d69ffd951d93c76d9ee12e429a1871b71c65f21ad01"
],
"created_at": "2022-06-27T18:01:31.25"
},
{
"sender_id": 6,
"message_type": 3,
"message": null,
"img_urls": [
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/c16de0a7-0c8c-44fb-a87e-8a7afe4fbb27test1.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=2f747a45f9746911dd6c4a5d89357b1e5eea89567fe00d06eb3b5af998cf9402",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/fc0a2cf6-2c88-4fae-bf1b-0f96481606dftest2.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=ea45266547947eccefc1189891db66f4f5ba1a5e706f061b8eec11e2fc0321cc",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/6b06d600-52a8-40f1-a328-4f6cb3df615dtest3.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=011c1768a8a38df485be5af76ea59f5f672202040392fde31df27fb7fbefa024",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/3d6e58d2-ff68-40e0-81f0-c5df4c2aeb37%ED%95%98%EC%9D%B4.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=2bc9a4bd7188ac34ab1a6960b26763f5398c88533f45d8666607c97152c52b9a",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/21debba4-d5a5-4f4a-a9a9-4c17bbab4ce5%EB%B0%94%EC%9D%B4.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=e81f87f87383f29af6f51d69ffd951d93c76d9ee12e429a1871b71c65f21ad01"
],
"created_at": "2022-06-27T18:00:54.63"
},
{
"sender_id": 6,
"message_type": 3,
"message": null,
"img_urls": [
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/c16de0a7-0c8c-44fb-a87e-8a7afe4fbb27test1.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=2f747a45f9746911dd6c4a5d89357b1e5eea89567fe00d06eb3b5af998cf9402",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/fc0a2cf6-2c88-4fae-bf1b-0f96481606dftest2.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=ea45266547947eccefc1189891db66f4f5ba1a5e706f061b8eec11e2fc0321cc",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/6b06d600-52a8-40f1-a328-4f6cb3df615dtest3.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=011c1768a8a38df485be5af76ea59f5f672202040392fde31df27fb7fbefa024",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/3d6e58d2-ff68-40e0-81f0-c5df4c2aeb37%ED%95%98%EC%9D%B4.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=2bc9a4bd7188ac34ab1a6960b26763f5398c88533f45d8666607c97152c52b9a",
"https://cotchan-test-bucket.s3.ap-northeast-2.amazonaws.com/chat-image/21debba4-d5a5-4f4a-a9a9-4c17bbab4ce5%EB%B0%94%EC%9D%B4.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T091750Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Credential=AKIA4EAIYFA4UNFHSYQQ%2F20220627%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=e81f87f87383f29af6f51d69ffd951d93c76d9ee12e429a1871b71c65f21ad01"
],
"created_at": "2022-06-27T17:47:11.641"
},
{
"sender_id": 6,
"message_type": 1,
"message": "ํ
์คํธ ๋ฉ์์ง ์
๋๋ค",
"img_urls": null,
"created_at": "2022-06-27T17:43:40.243"
}
]
- ์ฌ์ฉ์๋ ์ฑํ
๋ฐฉ ๋ด์์ ์์ ์ด ์ฝ์ ๋ฉ์์ง ๊ฐฏ์๋ฅผ ์์ ํ ์ ์๋ค.
- ex. ์ฑํ ๋ฐฉ ํ๋ฉด์ ๋๋ ๊ฒฝ์ฐ ์์ ์ด ์ฝ์ ๋ฉ์์ง ๊ฐฏ์ ๊ฐฑ์
PUT /chat/messages/read-size
param | type | required | description |
---|---|---|---|
room_id | body | true | ์ฑํ ๋ฃธID |
{
"room_id": "62a980eb794e3f5281741e76"
}
- ์ฑ๊ณต(200)
{
}
- ์คํจ(403)
- ์์ ์ด ์ฐธ์ฌํ๊ณ ์์ง ์์ ์ฑํ ๋ฐฉ์ ๋ํด API๋ฅผ ํธ์ถํ๋ ๊ฒฝ์ฐ
{
"message": "Authority error (cause: ์์ ์ด ์ฐธ์ฌ์ค์ธ ์ฑํ
๋ฐฉ์ด ์๋๋๋ค.)",
"status": 403,
"invalid_fields": null
}