CART API Doc - Kim-Gyuri/bookstore GitHub Wiki

  • μž₯λ°”κ΅¬λ‹ˆ 쑰회
  • μž₯λ°”κ΅¬λ‹ˆμ— μƒν’ˆ λ‹΄κΈ°
  • μž₯λ°”κ΅¬λ‹ˆμ— λ‹΄κΈ΄ μƒν’ˆ μ‚­μ œ

βœ… μž₯λ°”κ΅¬λ‹ˆ 쑰회

request-fields

Path Type Description
userId String νšŒμ› 아이디

Example request

GET /api/carts?userId=test
Host: localhost:8080

Example response

HTTP 200 ok
Content-Type: application/json
RESPONSE BODY
[
    {
        "orderItemId": 67,
        "loginId": null,
        "itemName": "Ariana Grande",
        "mainImg_savePath": "https://github.com/Kim-Gyuri/bookstore/assets/57389368/3bd66ffe-53fe-4e7f-b676-4909ccddbb4b",
        "count": 5,
        "orderPrice": 60000
    },
    {
        "orderItemId": 68,
        "loginId": null,
        "itemName": "BAEK HYUN",
        "mainImg_savePath": "https://github.com/Kim-Gyuri/bookstore/assets/57389368/27392311-6b6c-4852-8087-6a12834b9908",
        "count": 2,
        "orderPrice": 60000
    }
]

βœ… μž₯λ°”κ΅¬λ‹ˆμ— μƒν’ˆ λ‹΄κΈ°

request-fields

Path Type Description
userId String νšŒμ› 아이디
count Integer μ£Όλ¬Έ μˆ˜λŸ‰
itemId Long μƒν’ˆ 번호

Example request

POST /api/items/11?loginId=test4&count=2
Host: localhost:8080

Example response

HTTP 200 ok
{
    "success": true,
    "message": "success!"
}

βœ… μž₯λ°”κ΅¬λ‹ˆμ— λ‹΄κΈ΄ μƒν’ˆ μ‚­μ œ

request-fields

Path Type Description
itemId Long μƒν’ˆ 번호

Example request

DELETE /api/carts/69
Host: localhost:8080

Example response

HTTP 200 ok
{"success":true,"message":"success!"}