ITEM API Doc - Kim-Gyuri/bookstore GitHub Wiki
- μν λ±λ‘νκΈ°
- λ±λ‘ μ±κ³΅νμ λ
- λ±λ‘ μ€ν¨νμ λ (μν μ΄λ¦, μν μΉ΄ν
κ³ λ¦¬κ° λμΌν μνμ λ±λ‘ν λ)
- λ±λ‘ν μν μμ νκΈ°
- λ±λ‘ν μν μμ νκΈ°
- λ±λ‘ν μν μ‘°ν (μν idλ‘ μ‘°ν)
β
μν λ±λ‘νκΈ°
1. λ±λ‘ μ±κ³΅νμ λ
request-fields
Path |
Type |
Description |
files |
File |
μν μ΄λ―Έμ§ |
loginId |
String |
νμ μμ΄λ |
itemName |
String |
μν μ΄λ¦ |
quantity |
Integer |
μν μλ |
itemType |
String |
μν λ±κΈ |
categoryType |
String |
μν μΉ΄ν
κ³ λ¦¬ |
Example request
POST /api/items
Content-Type: multipart/form-data; boundary=--------------------------707314556211009394529486
Host: localhost:8080
request body; {
files: undefined
loginId: "test2"
itemName: "μ΄μ½ μ² ν μ΄μΌ"
quantity: "10"
itemType: "BEST"
categoryType: "BOOK"
}
Example response
HTTP 201 created
Response Body {"id":62}
2. μν λ±λ‘ μ€ν¨νμ λ (κ°μ μνλͺ
, μΉ΄ν
κ³ λ¦¬ κ²½μ°)
Example response
HTTP 409Conflict
Response Body {μ΄λ―Έ λ±λ‘λ μνμ΄ μ‘΄μ¬ν©λλ€.}
β
λ±λ‘ν μν μμ νκΈ°
request-fields
Path |
Type |
Description |
itemId |
Long |
μν λ²νΈ |
Example request
DELETE api/items/3
Host: localhost:8080
Example response
HTTP 200 ok
RESPONSE BODY { "success": true, "message": "μνμ΄ μμ λμμ΅λλ€." }
β
λ±λ‘ν μν μμ νκΈ°
request-fields
Path |
Type |
Description |
itemId |
Long |
μν λ²νΈ |
Example request
PATCH /api/items/1
Content-Type: multipart/form-data; boundary=--------------------------525302011217717751198166
Host: localhost:8080
Request Body {
multipartFileList: (postmanμΌλ‘ 2κ° λ±λ‘)
itemName: "μ΄μ½ μ² ν μ΄μΌ"
quantity: "10"
}
Example response
HTTP 200 ok
{"id":1,"itemName":"μ΄μ½ μ² ν μ΄μΌ","main_img_path":"https://github.com/Kim-Gyuri/bookstore/assets/57389368/c87b0c45-1ac6-41c3-beb2-82cd80d8c7fd"}
// μλ 1κ° μλ μν μ 보μλλ° 2κ° λ±λ‘ν΄μ 3κ°κ° μ‘°νλλ€.
μΆκ°λ‘ λ±λ‘ν μ΄λ―Έμ§ νμΌ μ 보=https://github.com/Kim-Gyuri/bookstore/assets/57389368/62c68662-fd5a-4e15-90a3-7279d99c94cf
μΆκ°λ‘ λ±λ‘ν μ΄λ―Έμ§ νμΌ μ 보=C:/newThing/chimm/a8a3040b-7b2e-41e1-b973-228fe0e4bba1..PNG
μΆκ°λ‘ λ±λ‘ν μ΄λ―Έμ§ νμΌ μ 보=C:/newThing/chimm/221f95eb-a59d-4695-8684-10db5ca5edb4..PNG
β
λ±λ‘ν μν μ‘°ν (μν idλ‘ μ‘°ν)
request-fields
Path |
Type |
Description |
itemId |
Long |
μν λ²νΈ |
Example request
GET /api/items/1
Accept: */*
Host: localhost:8080
Example response
HTTP 200 ok
Content-Type: application/json
---- ( response body) -----
{
"id": 1,
"name": "1984",
"price": 10000,
"quantity": 10,
"itemType": "HIGHEST",
"categoryType": "BOOK",
"status": "SELL",
"itemImgDtoList": [
{
"id": 2,
"imgName": "1984.jpg",
"originImgName": "origin.jpg",
"savePath": "https://github.com/Kim-Gyuri/bookstore/assets/57389368/c87b0c45-1ac6-41c3-beb2-82cd80d8c7fd",
"yn": null
}
]
}