API Document - polynomeer/sidedish GitHub Wiki
API Document
Overview
- ๋๋ฏธ๋ฐ์ดํฐ ์ฐธ๊ณ ๋งํฌ
- ์นดํ ๊ณ ๋ฆฌid๋ 3๊ฐ๋ก ๊ณ ์ Main/Soup/Side(17011000, 171011100, 171011200)
Category API
Category Read
-
Description : ๋ชจ๋ ์นดํ ๊ณ ๋ฆฌ๋ชฉ๋ก ์กฐํ
-
Request
GET /main
- Response
[
{
"categoryId": 17011000,
"name": "ํ์ฑํ ๊ณ ๊ธฐ ๋ฐ์ฐฌ",
"items": [
{
"detailHash": "H9882",
"image": "https://cdn.bmf.kr/_data/product/H077F/f2a7b4df359c850b1a9eb57e17ddf6fc.jpg",
"alt": "[์์คํ์์ฌ] ๊ฒฝ์๋ ํ์์ฐจ๋ฆผ",
"deliveryType": [
"์๋ฒฝ๋ฐฐ์ก ์ ๊ตญํ๋ฐฐ"
],
"title": "[์์คํ์์ฌ] ๊ฒฝ์๋ ํ์์ฐจ๋ฆผ",
"description": "๊ฒฝ์๋ ๋ช
๋ฌผ ์๋ฆฌ ์ธ ๊ฐ์ง๋ฅผ ํ ์์!",
"normalPrice": 39000,
"salePrice": 31200,
"badge": [
"์ด๋ฒคํธํน๊ฐ"
]
}
]
},
{
"categoryId": 17011100,
"name": "๋ฐ๋คํฅ๊ฐ๋ ๋ฐ์ฐฌ",
"items": [
{
"detailHash": "H9883",
"image": "https://cdn.bmf.kr/_data/product/H9881/f2a7b4df359c850b1a9eb57e17ddf6fc.jpg",
"alt": "[์์คํ์์ฌ] ๊ฒฝ์๋ ํ์์ฐจ๋ฆผ",
"deliveryType": [
"์๋ฒฝ๋ฐฐ์ก ์ ๊ตญํ๋ฐฐ"
],
"title": "[์์คํ์์ฌ] ๊ฒฝ์๋ ํ์์ฐจ๋ฆผ",
"description": "๊ฒฝ์๋ ๋ช
๋ฌผ ์๋ฆฌ ์ธ ๊ฐ์ง๋ฅผ ํ ์์!",
"normalPrice": 39000,
"salePrice": 31200,
"badge": [
"๋ก ์นญํน๊ฐ",
" ์ด๋ฒคํธํน๊ฐ"
]
}
]
},
{
"categoryId": 17011200,
"name": "ํ ์ธํน๊ฐ ์ธํธ ์์์",
"items": [
{
"detailHash": "H9881",
"image": "https://cdn.bmf.kr/_data/product/H9881/f2a7b4df359c850b1a9eb57e17ddf6fc.jpg",
"alt": "[์์คํ์์ฌ] ๊ฒฝ์๋ ํ์์ฐจ๋ฆผ",
"deliveryType": [
"์๋ฒฝ๋ฐฐ์ก ์ ๊ตญํ๋ฐฐ"
],
"title": "[์์คํ์์ฌ] ๊ฒฝ์๋ ํ์์ฐจ๋ฆผ",
"description": "๊ฒฝ์๋ ๋ช
๋ฌผ ์๋ฆฌ ์ธ ๊ฐ์ง๋ฅผ ํ ์์!",
"normalPrice": 39000,
"salePrice": 31200,
"badge": [
"์ด๋ฒคํธํน๊ฐ"
]
}
]
}
]
Item API
Item Read
-
Description : ํน์ ์์ดํ ์ ๊ฐ์ ธ์ด. ์ด๋ ์นดํ ๊ณ ๋ฆฌid์ ์์ดํ ์ ํด์๊ฐ์ด ๋ง์์ผ ์ ์ ์ถ๋ ฅ๋๋ค.
-
Request
GET /detail/{categoryId}/{hash}
- Response
{
"detailHash": "H077F",
"title": "[๋ง๋์ค์ฐฌ] ์ฝ๋ค๋ฆฌ๊ตฌ์ด 320g",
"topImage": "http://public.codesquad.kr/jk/storeapp/data/0221110ead70dfd455e40703bbdd6252.jpg",
"thumbImages": [
"http://public.codesquad.kr/jk/storeapp/data/0221110ead70dfd455e40703bbdd6252.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/2d408898494ac950d7d2cfd6c36d59c2.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/62c8bb77facfc9c3be81f9bf45b27f2a.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/f6d73afc0ebc1efa71eaea32e9d846f2.jpg"
],
"productDescription": "ํผ์ง๋งํ๊ณ ์ด์ง ๋ง์ ๋ํ ํ ๋ง๋ฆฌ๋ก ๋ง๋ ์ฝ๋ค๋ฆฌ๊ตฌ์ด์
๋๋ค.",
"point": 75,
"deliveryInfo": "์์ธ ๊ฒฝ๊ธฐ ์๋ฒฝ๋ฐฐ์ก / ์ ๊ตญํ๋ฐฐ (์ ์ฃผ ๋ฐ ๋์์ฐ๊ฐ ๋ถ๊ฐ) [์ ยท ํ ยท ์ ยท ๋ชฉ ยท ๊ธ ยท ํ ] ์๋ น ๊ฐ๋ฅํ ์ํ์
๋๋ค.",
"deliveryFee": "2,500์ (40,000์ ์ด์ ๊ตฌ๋งค ์ ๋ฌด๋ฃ)",
"prices": [
"7500"
],
"badge": [
"๋ก ์นญํน๊ฐ"
],
"detailSection": [
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/9bd9158fb5ffbc46708b7928ee50708e.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/5f73c5c80b62ef63c8a8eecefe32fc29.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/9bd9158fb5ffbc46708b7928ee50708e.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/0253cdebc4972fefd6b94458024fe765.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/3299da0677b50c8c519adc0335271c49.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/0642265b65dcc2490ab164ff428cbfe2.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/695683493c1ae475a175475f50d3259f.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/c8f9bed4f5c07585b869e3d171904a93.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/d2e3274c95c832bc9bfbcebbd548f61b.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/d9e4fa00652483d74b46317d38159a2f.jpg",
"http://public.codesquad.kr/jk/storeapp/data/detail/HDF73/d7799b67683128642453f9e2b4c8ce84.jpg"
],
"stock": 10
}
Order API
Order by POST
-
Description : ํน์ ์์ดํ ์ ์ฃผ๋ฌธ
-
Request
POST /detail/{categoryId}/{hash}
- Request Body
{
"orderCount" : int
}
- Response
no response body
- History์ create๋ ์๋ฒ์์ ๋ชจ๋ api๊ฐ ํธ์ถ๋ ๋ ๋ง๋ค ํธ์ถ๋๋๋ก ๊ตฌํ
- History์ update/delete๋ ๋ถ๊ฐ๋ฅํ๋๋ก ๊ตฌํ
References
REST API design with Spring
RESTful URL design
- https://restfulapi.net/resource-naming/
- https://digitalbourgeois.tistory.com/54
- https://sanghaklee.tistory.com/57
- https://apiguide.readthedocs.io/en/latest/build_and_publish/use_RESTful_urls.html