Docker runs MySQL database and spring rest API with predefined data of goods!
Rest API:
- port - 8080
MySql Database:
- port: 3306
git clone https://github.com/Snoke19/order_management.git
cd ./order_management
docker compose up
cd ./order_management
./mvnw clear test
curl -X POST --location "http://localhost:8080/api/v1/good" \
-H "Content-Type: application/json" \
-d "{
\"description\": \"IPhone 11\",
\"name\": \"IPhone 11 - best phone!\",
\"price\": 40000,
\"quantity\": 5
}"
curl -X GET --location "http://localhost:8080/api/v1/goods" \
-H "Content-Type: application/json"
[
{
"name": "iPhone 12",
"description": "Flagship smartphone from Apple",
"price": 1000,
"quantity": 50,
"id": 1
}
]
curl -X POST --location "http://localhost:8080/api/v1/order" \
-H "Content-Type: application/json" \
-d "{
\"infoGoodOrders\": [{
\"idGood\": 7,
\"quantityBuy\": 2
}]
}"
curl -X GET --location "http://localhost:8080/api/v1/orders" \
-H "Content-Type: application/json"
[
{
"orderId": 1,
"created": "2023-11-17T00:01:58",
"status": "PAID",
"orderGoodDetails": [
{
"goodId": 7,
"name": "Samsung Galaxy Tab S7",
"price": 600,
"quantityBuy": 2
}
]
}
]
curl -X POST --location "http://localhost:8080/api/v1/order/pay" \
-H "Content-Type: application/json" \
-d "{
\"orderId\": 1
}"