GET /api/products
# 응답
200
[
{
"product_id": 1,
"price": 10000,
"name": "치킨",
"image_url": "http://example.com/chicken.jpg"
},
...
]
POST /api/products
# 요청
{
"price": 10000,
"name": "치킨",
"image_url": "http://example.com/chicken.jpg"
}
# 응답
201
header
Location: /api/products/{product_id}
GET /api/products/{product_id}
# 응답
200
{
"product_id": 1,
"price": 10000,
"name": "치킨",
"image_url": "http://example.com/chicken.jpg"
}
DELETE /api/products/{product_id}
# 응답
204
GET /api/customers/{customer_name}/carts
# 응답
200
[
{
"cart_id": 1,
"price": 10000,
"name": "치킨",
"image_url": "http://example.com/chicken.jpg"
},
...
]
POST /api/customers/{customer_name}/carts
# 요청
{
"product_id": 1
}
# 응답
201
header
Location: /api/customers/{customer_name}/carts/{cart_id}
DELETE /api/customers/{customer_name}/carts/{cart_id}
# 응답
204
POST /api/customers/{customer_name}/orders
# 요청
[
{
"cart_id": 1,
"quantity": 5
},
...
]
# 응답
201
header
Location: /api/customers/{customer_name}/orders/{order_id}
GET /api/customers/{customer_name}/orders
# 응답
200
[
{
"order_id": 1,
"order_details": [
{
"product_id": 1,
"price": 10000,
"name": "치킨",
"image_url": "http://example.com/chicken.jpg",
"quantity": 5
},
...
]
},
...
]
GET /api/customers/{customer_name}/orders/{order_id}
# 응답
200
{
"order_id": 1,
"order_details": [
{
"product_id": 1,
"price": 10000,
"name": "치킨",
"image_url": "http://example.com/chicken.jpg",
"quantity": 5
},
...
]
}