코틀린으로 간단한 api 서버를 만든다.
주문하기
주문목록조회
주문상세조회
POST /orders
X-USER-ID: cbw
{
"productId": 1,
"quantity": 2,
"totalPrice": 2000
}HTTP/1.1 200 OkGET /orders
X-USER-ID: cbwHTTP/1.1 200 Ok
Content-Type: application/json
[
{
"id": 1,
"productId": 1,
"quantity": 2,
"totalPrice": 2000
},
{
"id": 2,
"productId": 2,
"quantity": 3,
"totalPrice": 6000
}
]GET /orders/1HTTP/1.1 200 Ok
Content-Type: application/json
{
"id": 1,
"productId": 1,
"quantity": 2,
"totalPrice": 2000
}./gradlew test./gradlew build./gradlew bootRun