=============================
A simple web application for managing a parking lot.
git clone https://github.com/fahmimmaliki/parking-lot-management.git
mvn install
docker compose up
This will start the application and make it available at http://localhost:8080/api/parking
.
http://localhost:8080/api/parking
GET /api/parking/places
JSON Body Example:
{}
Response:
{
"availablePlaces": 10
}
POST /api/parking/park
JSON Body Example:
{
"licensee": "ABC123"
}
Response:
{
"message": "Car parked successfully"
}
POST /api/parking/leave/{id}
JSON Body Example:
{}
Response:
{
"message": "Car has left. Bill: 5000"
}
GET /api/parking/cars
JSON Body Example:
{}
Response:
[
{
"id": 1,
"licensee": "ABC123",
"arrival": "2023-02-20T14:30:00",
"leave": "2023-02-20T15:30:00",
"parked": true,
"bill": 5000
},
{
"id": 2,
"licensee": "DEF456",
"arrival": "2023-02-20T15:30:00",
"leave": "2023-02-20T16:30:00",
"parked": true,
"bill": 5000
}
]
PATCH /api/parking/settings
JSON Body Example:
{
"totalPlaces": 15,
"payPerHour": 4000,
"payFirstHour": 6000
}
Response:
{
"message": "Settings updated successfully"
}
GET /api/parking/history
JSON Body Example:
{}
Response:
[
{
"licensee": "ABC123",
"arrival": "2023-02-20T14:30:00",
"leave": "2023-02-20T15:30:00",
"bill": 5000
},
{
"licensee": "DEF456",
"arrival": "2023-02-20T15:30:00",
"leave": "2023-02-20T16:30:00",
"bill": 5000
}
]
I hope this helps! Let me know if you have any questions or need further assistance.