-
Notifications
You must be signed in to change notification settings - Fork 0
03) eCommerce
choi jae ho edited this page May 26, 2021
·
13 revisions
- Eclipse
- Postman
- MySQL Workbench
- Sourcetree
- GitHub
- Product와 Category를 관리하는 Rest API를 구현한다.
-
- Product는 다수개의 Category에 속할 수 있다. 즉, 전동 칫솔은 "Electronics" 와 "Beauty & Personal Care" 카테고리로 분류될 수 있다.
-
- Category는 다수개의 SubCategory를 가질 수 있다. 예를 들어 “Electronics” category는 'Audio & Video Components', 'Camera & Photo', ‘Computers’ SubCategory를 가질 수 있다.
HTTP | URL | 설명 |
---|---|---|
GET | /api/products | 모든 product를 조회한다 |
GET | /api/products/{id} | 특정 id를 가진 product를 조회한다 |
POST | /api/products Body { "name": "P1", "price": 100.00 } |
하나의 product을 생성한다 |
PUT | /api/products/{id} Body { "name": "P1", "price": 100.00 } |
하나의 product을 수정한다 |
DELETE | /api/products/{id} | 특정 id를 가진 product를 삭제한다 |
HTTP | URL | 설명 |
---|---|---|
GET | /api/categories | 모든 category를 조회한다 |
GET | /api/categories/{id} | 특정 id를 가진 category를 조회한다 |
POST | /api/categories Body { "name": "C1", "price": 100.00 } |
하나의 category을 생성한다 |
PUT | /api/categories/{id} Body { "name": "C1", "price": 100.00 } |
하나의 category을 수정한다 |
DELETE | /api/categories/{id} | 특정 id를 가진 category를 삭제한다 |
HTTP | URL | 설명 |
---|---|---|
GET | /api/categories/{parentid}/subcategories | 특정 parentid를 가진 카테고리에 속한 자식카테고리를 조회한다. |
POST | /api/categories/{parentid}/subcategories/{childid} | Parent category와 child category를 연결한다 |
DELETE | /api/categories/{parentid}/subcategories/{childid} | Parent category에서 child category를 제거한다 |
HTTP | URL | 설명 |
---|---|---|
GET | /api/categories/{categoryid}/products | 특정 id를 가진 category에 속한 모든 product를 조회한다 |
POST | /api/categories/{categoryid}/products/{productid} | Product를 category에 넣는다 |
DELETE | /api/categories/{categoryid}/products/{productid} | Product를 category에서 제거한다 |