Product API 문서 - f-lab-edu/at_ticket GitHub Wiki



Product API 문서

version 1.0.0-SNAPSHOT

상품 조회

Request

GET /products HTTP/1.1
Host: localhost:8080

Request Parameters

Parameter Description

page

페이지 넘버

perPage

페이당 표시 수

keyword

키워드

category

카테고리

subCategory

서브카테고리

region

지역

startDate

공연 시작 날짜

endDate

공연 종료 날짜

sortOption

정렬 옵션

Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 568

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다.",
  "data" : {
    "products" : [ {
      "category" : "MUSICAL",
      "subCategory" : "ORIGINAL",
      "id" : 1,
      "name" : "캣츠",
      "image" : "http://image.img",
      "place" : {
        "id" : 1,
        "name" : "서울 공연장1",
        "region" : "서울"
      },
      "startDate" : "2023-05-31",
      "endDate" : "2024-06-30",
      "runningTime" : "02:00:00",
      "interMission" : "20:00:00",
      "ageLimit" : "12세 이상 이용가"
    } ]
  }
}

Response Fields

Path Type Description

code

Number

결과코드

message

String

결과 메세지

data.products[].id

Number

공연 ID

data.products[].name

String

공연 이름

data.products[].category

String

공연 카테고리

data.products[].subCategory

String

공연 서브 카테고리

data.products[].image

String

공연 이미지

data.products[].place.id

Number

공연 장소 ID

data.products[].place.name

String

공연장소 이름

data.products[].place.region

String

공연 장소 지역

data.products[].startDate

String

공연 시작일

data.products[].endDate

String

공연 종료일

data.products[].runningTime

String

공연 상영시간

data.products[].interMission

String

공연 휴식시간

data.products[].ageLimit

String

공연 관람 제한 나이

상품 상세 조회

Request

GET /products/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080

Path Parameter

Table 1. /products/{productId}
Parameter Description

productId

상품 ID

Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 568

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다.",
  "data" : {
    "product" : {
      "name" : "캣츠",
      "explain" : "공연설명",
      "category" : "MUSICAL",
      "subCategory" : "ORIGINAL",
      "runningTime" : "02:00:00",
      "startDate" : "2023-03-01",
      "endDate" : "2024-06-30",
      "ageLimit" : "TWELVE",
      "image" : "http://image.img",
      "region" : "SEOUL"
    },
    "seatGrades" : [ {
      "type" : "A",
      "price" : 1000
    } ],
    "showDates" : [ "2023-03-01", "2023-03-02" ]
  }
}

Response Fields

Path Type Description

code

Number

결과코드

message

String

결과 메세지

data.product.name

String

공연 이름

data.product.explain

String

등급 설명

data.product.category

String

공연 카테고리

data.product.subCategory

String

공연 서브 카테고리

data.product.runningTime

String

공연 상영시간

data.product.startDate

String

공연 시작일

data.product.endDate

String

공연 종료일

data.product.ageLimit

String

공연 관람 제한 나이

data.product.image

String

공연 이미지

data.product.region

String

공연 상연 지역

data.showDates[]

Array

공연 지역

data.seatGrades[].type

String

좌석 등급

data.seatGrades[].price

Number

좌석 가격

일자별 공연 조회

Request

GET /products/1/shows?date=2023-05-31 HTTP/1.1
Host: localhost:8080

Path Parameter

Table 2. /products/{productId}/shows
Parameter Description

productId

공연 ID

Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 185

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다.",
  "data" : {
    "shows" : [ {
      "id" : 1,
      "session" : 1,
      "time" : "10:00:00"
    } ]
  }
}

Response Fields

Path Type Description

code

Number

결과코드

message

String

결과 메세지

data.shows[].id

Number

공연 ID

data.shows[].session

Number

공연 순번

data.shows[].time

String

공연 시각

상품 삭제

Request

DELETE /products/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080

Path Parameter

Table 3. /products/{productId}
Parameter Description

productId

상품 ID

Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 71

{
  "code" : 200,
  "message" : "요청에 성공하셨습니다."
}

Response Fields

Path Type Description

code

Number

결과코드

message

String

결과 메세지

Version 1.0.0-SNAPSHOT
Last updated 2023-10-20 16:46:58 +0900

⚠️ **GitHub.com Fallback** ⚠️