-
Notifications
You must be signed in to change notification settings - Fork 1
μν
Lucas edited this page Jan 3, 2020
·
25 revisions
Context-type : application/json
λ©μλ | κ²½λ‘ | 짧μ μ€λͺ |
---|---|---|
GET | /goods?category=coat&page=7&sort=newest | μΉ΄ν κ³ λ¦¬ λ³ μν리μ€νΈ μ‘°ν |
/goods?category=coat&page=7
- category={μΉ΄ν κ³ λ¦¬ μ}
- page={νμ΄μ§ μ}
- sort={newest: μ΅μ μ}
Success
"code": 200,
"json": {
"success": true,
"message": "coat 리μ€νΈ 6κ° μ‘°ν",
"data": [
{
"mainImg": "https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577903952662.jpg",
"price": 85000,
"_id": "5e0ce753e055d50011a1d651",
"goodsName": "λ¬λΈλ¦¬ λ μ΄μ€ μ½νΈ",
"sellerName": "κΈ°μλ―Έν¨λν¨λ",
"sellerId": "5e0a4763217f2200119b6042",
"like": false
},
{
"mainImg": "https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577906946492.jpg",
"price": 125000,
"_id": "5e0cf308e055d50011a1d65d",
"goodsName": "λΈλ μΊμλ―Έμ΄ μ€λ²ν μ½νΈ",
"sellerName": "νμ μλνμ λ―Ό",
"sellerId": "5e0a4d19217f2200119b6053",
"like": false
},
{
"mainImg": "https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577908158187.jpg",
"price": 27500,
"_id": "5e0cf7c6e055d50011a1d661",
"goodsName": "λ‘λΈ μΈ μ½νΈ",
"sellerName": "νμ μλνμ λ―Ό",
"sellerId": "5e0a4d19217f2200119b6053",
"like": false
},
{
"mainImg": "https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577948199142.jpg",
"price": 63000,
"_id": "5e0d942be055d50011a1d697",
"goodsName": "λ°μ΄μ§ κ½μμ μΈ μ½νΈ",
"sellerName": "μν΄κ΅¬νλμνμ ",
"sellerId": "5e0a4b8a217f2200119b604e",
"like": false
}
]
}
}
Fail : 리μ€νΈ μ‘°ν μ€ν¨
{
"code": 403,
"json": {
"success": false,
"message": "${category} 리μ€νΈ μ‘°ν μ€ν¨",
}
}
Fail : μλ² λ΄λΆ μ€λ₯
{
"code": 500,
"json": {
"success": false,
"message": "μλ² λ΄λΆ μ€λ₯"
}
}
Context-type : application/json
λ©μλ | κ²½λ‘ | 짧μ μ€λͺ |
---|---|---|
GET | goods/:goodsId | μνμ μμΈ λν μΌμ νμΈ |
Response
ν
μ€νΈ ν goodsId κ°: 5e0ce3f0e055d50011a1d64e
Success
{
"code": 200,
"json": {
"success": true,
"message": "μ ν λν
μΌ μ‘°ν μ±κ³΅",
"data": {
"comment": "νΌν 컬λ¬μ νλ¦¬μΈ λ²¨λ²³ μμ΄λ ν¬μΈ μ
λλ€.",
"img": [
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577903085757.jpg",
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577903086627.jpg",
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577903086925.jpg"
],
"grade": 0,
"condition": 10,
"_id": "5e0ce3f0e055d50011a1d64e",
"size": "lg"
}
}
}
Fail : μΈμ¦ μ΄λ©μΌ μ μ‘ μ€ν¨
{
"code": 400,
"json": {
"success": false,
"message": "μ ν λν
μΌ μ‘°ν μ€ν¨",
}
}
Context-type : application/json
λ©μλ | κ²½λ‘ | 짧μ μ€λͺ |
---|---|---|
GET | /goods/seller/:sellerId | ν΄λΉ μ νμ ν맀νλ ν맀μμ λ€λ₯Έ μνμ μ΅μ μμΌλ‘ 보μ¬μ€ |
ν μ€νΈ ν sellerId κ° : 5e0a3d33217f2200119b6036
Success
{
"code": 200,
"json": {
"success": true,
"message": "μ‘΄μ¬νλ ν맀μμ λ€λ₯Έ μν μ
λλ€.",
"data": [
{
"_id": "5e0d06d4e055d50011a1d686",
"goodsName": "μ€ν± μ₯λ―Έ μνΌμ€",
"mainImg": "https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577912015078.jpg",
"price": 26000
},
{
"_id": "5e0d09c8e055d50011a1d689",
"goodsName": "λ§ν¬μ μ΄μ½₯μ€ νν
λ°±",
"mainImg": "https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577912756285.jpg",
"price": 25000
},
{
"_id": "5e0d28cfe055d50011a1d695",
"goodsName": "mcmλ°λ",
"mainImg": "https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577920717044.jpg",
"price": 35000
},
{
"_id": "5e0df2d5e055d50011a1d69d",
"goodsName": "lee μΌμ μ°μ²μμ§ λ°λ",
"mainImg": "https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577972435661.jpg",
"price": 45000
}
]
}
}
Fail : μ‘΄μ¬νμ§ μλ ν맀μ.
{
"code": 400,
"json": {
"success": true,
"message": "μ‘΄μ¬νμ§ μλ ν맀μμ
λλ€.",
}
}
Fail : μλ² λ΄λΆ μλ¬
{
"code": 500,
"json": {
"success": true,
"message": "ν맀μμ λ€λ₯Έ μν μ‘°ν μ€ν¨",
}
}
Context-type : application/json
λ©μλ | κ²½λ‘ | 짧μ μ€λͺ |
---|---|---|
GET | /goods/:goodId/like | ν΄λΉ μνμ΄ μ μ μκ² μ’μμ(μ°) λμ΄μλμ§ νμΈ |
Success
{
"code": 200,
"json": {
"success": true,
"message": "μ‘΄μ¬νλ μ’μμ μ
λλ€.",
"data": [
{
"_id": "μνμ κ³ μ idκ°",
"goodsName": "μν μ΄λ¦",
"mainImg": "μν λ©μΈ μ΄λ―Έμ§",
"prise": "κ°κ²©"
}
]
}
}
Success : μ‘΄μ¬νμ§ μλ ν맀μ.
{
"code": 200,
"json": {
"success": true,
"message": "μ‘΄μ¬νμ§ μλ μ’μμ μ
λλ€.",
}
}
Fail : μλ² λ΄λΆ μλ¬
{
"code": 500,
"json": {
"success": true,
"message": "μ’μμ μ¬λΆ μ‘°ν μ€ν¨",
}
}
Context-type : application/json
λ©μλ | κ²½λ‘ | 짧μ μ€λͺ |
---|---|---|
POST | /goods/:goodId/like | μνμ μ’μμνκ±°λ / μ·¨μνκ±°λ |
body
{
"like": true,
}
- true: μ’μμ λλ₯΄κΈ°
- false: μ’μμ μ·¨μνκΈ°
Success : μ’μμ νκΈ°
{
"code": 200,
"json": {
"success": true,
"message": "'μ’μμ νκΈ°' μμ± μ±κ³΅",
"data": [
{
"goodsId": "μ’μμν μν Idκ°",
"like": true,
}
]
}
}
Success : μ’μμ μ·¨μ
{
"code": 200,
"json": {
"success": true,
"message": "'μ’μμ μ·¨μ' μμ± μ±κ³΅",
"data": [
{
"goodsId": "μ’μμν μν Idκ°",
"like": true,
}
]
}
}
Fail : μλ² λ΄λΆ μλ¬
{
"code": 500,
"json": {
"success": false,
"message": "μ’μμ μμ± μ€ν¨",
}
}
Context-type : application/json
λ©μλ | κ²½λ‘ | 짧μ μ€λͺ |
---|---|---|
POST | /goods/filter | μ 체 μνμ νν°λ§νμ¬ μ‘°ν |
body
{
"color": "brown",
"category": ["jacket","coat"],
"size": ["lg"]
}
Response
Success
{
"code": 200,
"json": {
"success": true,
"message": "μ ν νν°λ§μ μ±κ³΅νμμ΅λλ€.",
"data": [
{
"_id": "μν ObjectId",
"goodsName": "μνλͺ
",
"mainImg": "μν λ©μΈ μ΄λ―Έμ§",
"price": "κ°κ²©",
},
{
"_id": "μν ObjectId",
"goodsName": "μνλͺ
",
"mainImg": "μν λ©μΈ μ΄λ―Έμ§",
"price": "κ°κ²©",
},
]
}
}
// λλ―Έλ°μ΄ν° μμ
{
"code": 200,
"json": {
"success": true,
"message": "μ ν νν°λ§μ μ±κ³΅νμμ΅λλ€.",
"data": [
{
"img": [
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577907923687.jpg",
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577907925597.jpg",
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577907925874.jpg",
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577907925962.jpg",
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577907926103.jpg",
"https://fluff-s3.s3.ap-northeast-2.amazonaws.com/1577907926183.jpg"
],
"price": 24000,
"_id": "5e0cf6d7e055d50011a1d65f",
"goodsName": "λ°°μ체ν¬μμΌ"
}
]
}
}
Success : νν°λ§ 쑰건μ λ§λ μνμ΄ μλ κ²½μ°
{
"code": 200,
"json": {
"success": true,
"message": "νν°λ§ 쑰건μ λ§λ μνμ΄ μμ΅λλ€."
}
}
Fail : μλͺ»λ μμ²
{
"code": 400,
"json": {
"success": false,
"message": "μ ν νν°λ§μ μ€ν¨νμμ΅λλ€.",
}
}