카테고리 API - Soobinnn/CAT-24 GitHub Wiki

카테고리 API

카테고리(Categories)는 상품을 분류할 수 있는 목록임. 상품을 하나 이상의 카테고리에 진열해야 판매 가능함.

Categories Properties

Attribute Description
category_no 카테고리 분류
category_depth 분류 Depth
parent_category_no 부모 카테고리 분류
category_name 분류명
full_category_name 카테고리 전체이름
root_category_no 최상위 카테고리 분류
display_order 진열순서
reg_id 등록자
reg_date 등록일
update_id 수정자
update_date 수정일

Admin API

EndPoints

- 카테고리 전체 목록

Definition

GET /api/v1/admin/categories/

- Request Example

	curl -X 'GET' /api/v1/admin/categories/ 
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
	"data": [ {
	    "category_no" : 1,
	    "category_depth" : 0,
	    "parent_category_no" : 0,
	    "category_name" : "미분류",
	    "full_category_name" : "미분류3",
	    "full_category_no" : "0",
	    "root_category_no" : 0,
	    "display_order" : 1,
	    "reg_id" : "soobin",
	    "reg_date" : "2019-08-01",
	    "update_id" : "soobin",
	    "update_date" : "2019-08-01"
	  },
	  {
	    "category_no" : 2,
	    "category_depth" : 0,
	    "parent_category_no" : 0,
	    "category_name" : "상의",
	    "full_category_name" : "상의",
	    "full_category_no" : "0",
	    "root_category_no" : 0,
	    "display_order" : 2,
	    "reg_id" : "soobin",
	    "reg_date" : "2019-08-01",
	    "update_id" : "soobin",
	    "update_date" : "2019-08-01"
	  },
	  ...
	  ]
}

- 카테고리 전체 갯수

Definition

GET /api/v1/admin/categories/count

- Request Example

	curl -X 'GET' /api/v1/admin/categories/count 
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
    "data": {
             "count" : 3
            }
}

- 해당 카테고리 조회

Definition

GET /api/v1/admin/categories/{category_no}

- Request Example

	curl -X 'GET' /api/v1/admin/categories/1
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
	"data": {
	    "category_no" : 1,
	    "category_depth" : 0,
	    "parent_category_no" : 0,
	    "category_name" : "미분류",
	    "full_category_name" : "미분류3",
	    "full_category_no" : "0",
	    "root_category_no" : 0,
	    "display_order" : 1,
	    "reg_id" : "soobin",
	    "reg_date" : "2019-08-01",
	    "update_id" : "soobin",
	    "update_date" : "2019-08-01"
	  }
}

- 카테고리 등록

Definition

POST /api/v1/admin/categories/

- Request Example

	curl -X ' POST' /api/v1/admin/categories/
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'
             -D {'category_depth' : 0
                 'parent_category_no' : 0
                 'category_name' : "미분류"
                 'full_category_name' : "미분류"
                 'full_category_no' : "0"
                 'root_category_no' : 0 
                 'reg_id' : soobin
                 'update_id' : soobin
                }

- Response Example

 {
	"result" : "success",
        "message" : null,
        "data" : "success"
}

- 해당 카테고리 삭제

Definition

DELETE /api/v1/admin/categories/{category_no}

- Request Example

	curl -X ' DELETE' /api/v1/admin/categories/1
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

 {
	"result" : "success",
        "message" : null,
        "data" : "success"
}

- 해당 카테고리 수정

Definition

PUT /api/v1/admin/categories/{category_no}

- Request Example

	curl -X ' PUT' /api/v1/admin/categories/1
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'
             -D {'category_depth' : 0
                 'parent_category_no' : 0
                 'category_name' : "미분류"
                 'full_category_name' : "미분류"
                 'full_category_no' : "0"
                 'root_category_no' : 0 
                 'reg_id' : soobin
                 'update_id' : soobin
                }

- Response Example

 {
	"result" : "success",
        "message" : null,
        "data" : "success"
}

Front API

EndPoints

- 카테고리 전체 목록

Definition

GET /api/v1/categories/

- Request Example

	curl -X 'GET' /api/v1/categories/ 
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
	"data": [ {
	    "category_no" : 1,
	    "category_depth" : 0,
	    "parent_category_no" : 0,
	    "category_name" : "미분류",
	    "full_category_name" : "미분류",
	    "full_category_no" : "0",
	    "root_category_no" : 0,
	    "display_order" : 1,
	    "reg_id" : "soobin",
	    "reg_date" : "2019-08-01",
	    "update_id" : "soobin",
	    "update_date" : "2019-08-01"
	  },
	  {
	    "category_no" : 2,
	    "category_depth" : 0,
	    "parent_category_no" : 0,
	    "category_name" : "상의",
	    "full_category_name" : "상의",
	    "full_category_no" : "0",
	    "root_category_no" : 0,
	    "display_order" : 2,
	    "reg_id" : "soobin",
	    "reg_date" : "2019-08-01",
	    "update_id" : "soobin",
	    "update_date" : "2019-08-01"
	  },
	  ...
	  ]
}

- 카테고리 전체 갯수

Definition

GET /api/v1/categories/count

- Request Example

	curl -X 'GET' /api/v1/categories/count 
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
    "data": {
             "count" : 3
            }
}

- 해당 카테고리 조회

Definition

GET /api/v1/categories/{category_no}

- Request Example

	curl -X 'GET' /api/v1/categories/1
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
	"data": {
	    "category_no" : 1,
	    "category_depth" : 0,
	    "parent_category_no" : 0,
	    "category_name" : "미분류",
	    "full_category_name" : "미분류3",
	    "full_category_no" : "0",
	    "root_category_no" : 0,
	    "display_order" : 1,
	    "reg_id" : "soobin",
	    "reg_date" : "2019-08-01",
	    "update_id" : "soobin",
	    "update_date" : "2019-08-01"
	  }
}

- 카테고리 전체 갯수

Definition

GET /api/v1/categories/count

- Request Example

	curl -X 'GET' /api/v1/categories/count 
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
    "data": {
             "count" : 3
            }
}

- 해당 카테고리 상품 조회

Definition

GET /api/v1/categories/{category_no}/products

- Request Example

	curl -X 'GET' /api/v1/categories/1/products
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
	"data": [{
	    "product_no" : 1,
	    "product_code" : code1,
	    "custom_product_code" : customcode1,
	    "product_name" : "캣타워",
	    "model_name" : "cattower01",
	    "cost_price" : "111000",
	    "selling_price" : 333000,
	    "summary" : "고양이들이 좋아하는 캣타워",
	    "detail" : "인기만점 고양이들이 좋아하는 캣타워 신상품 ",
	    "product_image" : "/cattower.jpg",
            "product_subimage" : "/cattower2.jpg"
	    "sell_yn" : "N",
	    "discount_yn" : "N",
            "reg_id" : "soobin",
	    "reg_Date" : "2019-08-01",
	    "category_no" : "1"
	  },
          {
	    "product_no" : 2,
	    "product_code" : code2,
	    "custom_product_code" : customcode2,
	    "product_name" : "캣워크",
	    "model_name" : "catwalk01",
	    "cost_price" : "58000",
	    "selling_price" : 130000,
	    "summary" : "고양이 캣워크",
	    "detail" : "캣워크를 두면 고양이의 행복독점 캣워크",
	    "product_image" : "/catwalk.jpg",
            "product_subimage" : "/catwalk2.jpg"
	    "sell_yn" : "N",
	    "discount_yn" : "N",
            "reg_id" : "soobin",
	    "reg_Date" : "2019-08-01",
	    "category_no" : "1"
	  },
...]
}

- 해당 카테고리 상품 갯수

Definition

GET /api/v1/categories/{category_no}/products/count

- Request Example

	curl -X 'GET' /api/v1/categories/1/products/count 
             -H 'content-type: application/json' \
             -H 'X-Api-Version: {version}'

- Response Example

{
    "data": {
             "count" : 2
            }
}