- Java 17
- Postgres
- Docker
- Liquibase
- Intellij Idea
- Postman
- Spring boot - reactive
- At the root of the project run:
docker compose up -f docker/docker-compose.yml up -d
./gradlew -pdrone clean booRun
POST /drone HTTP/1.1
Host: localhost:8080
Content-Type: application/json
{
"serialNumber": "B2025",
"model": "LIGHTWEIGHT",
"state": "IDLE",
"weightLimit": 500,
"batteryCapacity": 100
}
{
"id": 3,
"serialNumber": "B2025",
"model": "LIGHTWEIGHT",
"weightLimit": 500,
"batteryCapacity": 100,
"state": "IDLE",
"createdAt": "2022-02-03T22:51:12.525587",
"updatedAt": "2022-02-03T22:51:12.525587"
}
PUT /drone/medication/3 HTTP/1.1
Host: localhost:8080
Content-Type: application/json
{
"name": "PARACETAMOL",
"weight": 150,
"code": "PARA304",
"image": "http://image.io"
}
{
"id": 16,
"name": "PARACETAMOL",
"weight": 150,
"code": "PARA304",
"image": "http://image.io",
"createdAt": "2022-02-03T22:51:43.957103",
"updatedAt": "2022-02-03T22:51:43.957103"
}
GET /drone/medication/3 HTTP/1.1
Host: localhost:8080
Content-Type: application/json
[
{
"id": 16,
"name": "PARACETAMOL",
"weight": 150,
"code": "PARA304",
"image": "http://image.io",
"createdAt": "2022-02-03T22:51:43.957103",
"updatedAt": "2022-02-03T22:51:43.957103"
}
]
GET /drone/available HTTP/1.1
Host: localhost:8080
Content-Type: application/json
[
{
"id": 1,
"serialNumber": "B2023",
"model": "LIGHTWEIGHT",
"weightLimit": 400,
"batteryCapacity": 90,
"state": "LOADING",
"createdAt": "2022-02-03T21:54:42.556699",
"updatedAt": "2022-02-03T21:54:42.556699"
},
{
"id": 3,
"serialNumber": "B2025",
"model": "LIGHTWEIGHT",
"weightLimit": 500,
"batteryCapacity": 100,
"state": "LOADING",
"createdAt": "2022-02-03T22:51:12.525587",
"updatedAt": "2022-02-03T22:51:12.525587"
}
]
GET /drone/3/battery-capacity HTTP/1.1
Host: localhost:8080
Content-Type: application/json
{
"id": 3,
"serialNumber": "B2025",
"batteryCapacity": 100
}