[Weneige] API Documentation

그냥·2022년 6월 27일
0

django

목록 보기
13/20

1. 회원가입

1. Method: POST
2. URI: IP:PORT/users/signup
3. Body:

{
	"name"   		: char type,
    "email"  		: char type,
    "password"  	: char type,
    "user_name" 	: char type,
    "address"   	: char type,
    "mobile_number" : char type
}

2. 로그인

request

1. Method: POST
2. URI: IP:PORT/users/login
3. Body:
{
	"email"    : char type,
    "password" : char type
}

response

{
	"token" : char type
}

3. 제품 상세

request

1. Method: GET
2. URI: IP:PORT/products/<int:product_id>

response

{
  "product_detail":
    {
      "product_id"  : char type,
      "kor_name"    : char type,
      "eng_name"    : char type,
      "description" : char type,
      "volume"      : char type,
      "price"       : int,
      "color"       : [char type, char type, char type],
      "image_url"   : [char type, char type, char type]
  	}
}

4. 제품 리스트

request

1. Method: GET
2. URI: IP:PORT/products

response

{
    "product_detail": [
        {
            "product_id": 1,
            "kor_name": "시그니처 브로우 펜슬",
            "price": 39000,
            "image_url": [
                "http://drive.google.com/uc?export=view&id=1qFs0uE_fipGlEVEUC3ogwEAr05vJT97c",
                "http://drive.google.com/uc?export=view&id=1VFJGC6s6FmpteJzr3armu1lLxPdZuYQT",
                "http://drive.google.com/uc?export=view&id=16y7MBVORqXlWVViKivHK5q6vAudEwMmL"
            ]
        },
        {
            "product_id": 2,
            "kor_name": "리퀴드 아이라이너",
            "price": 28000,
            "image_url": [
                "http://drive.google.com/uc?export=view&id=1a1fCT40LH8t2zVedrpmPUel57Y5-tjJ9",
                "http://drive.google.com/uc?export=view&id=16y7MBVORqXlWVViKivHK5q6vAudEwMmL"
            ]
        },
        {
            "product_id": 3,
            "kor_name": "볼륨 마스카라",
            "price": 38000,
            "image_url": [
                "http://drive.google.com/uc?export=view&id=1rezrPai3w1dDIbxqDK9FqdY_zxzMAAcC",
                "http://drive.google.com/uc?export=view&id=1VFJGC6s6FmpteJzr3armu1lLxPdZuYQT"
            ]
        }
    ]
}

5. 장바구니

1) 장바구니 물품 추가

1. Method: POST
2. URI: IP:PORT/carts
3. Headers: {"Authorization" : token}
4. Body:
{
	"product_option_id" : int type,
    "quantity"		    : int type
}

2) 장바구니 물품 조회

request

1. Metohd: GET
2. URI: IP:PORT/carts
3. Headers: {"Authorization" : token}

response

{ "results": [
  {
      "product_option_id": 2,
      "kor_name: "",
      "color": "",
      "price": int,
      "quantity": int,
      "name": "",
      "address": "",
      "image_url": ["", "", ""]
  }
  ]
}

3) 장바구니 물품 수량 수정

1. Method: POST
2. URI: IP:PORT/carts
3. Headers: {"Authorization" : token}
4. Body:
{
	"product_option_id" : 1,
    "quantity" 			: 3
}

4) 장바구니 물품 삭제

1. Method: DELETE
2. URI: IP:PORT/carts?product_option_id=(int type)&product_option_id=(int type)
3. Headers: {"Authorization" : token}

0개의 댓글

관련 채용 정보