A is a Java Spring Boot project to handle drone medication loading and unloading. The project was developed by Elirehema Paul from 29 Nov 2022 to 30 Nov 2022
- musala.project.drone
- api
- data
- exceptions
- model
- repository
- schedules
- services
- utils
-
- DroneApplication
The directory contains REST endpoints controllers
This directory contains Other Models classes which are not database entities
The directory for exception handling configurations. For this project it has single Exception handler class for other exception we just return the warning message to avoid Internal server errors.
The directory contains POJO classes for database table mapping i.e. Entities
The directory contains all CRUD repository implementations of Models
This director contains all classes responsible for scheduling activities e.g Battery level scheduler task
This contains all Medication and Drone read and write operations. All read and write operations are separated for clarity
DroneReadPlatformService.java
//Drone read operation interfaceDroneReadPlatformServiceImpl.java
// Implementation of drone read interfaceDroneWritePlatformService.java
// Drone write operation interfaceDroneWritePlatformServiceImpl.java
// Implementation of drone write interface- Medication R&W etc
This contains utility classes and swagger configurations
The platform uses H2 is an embedded, open-source, and in-memory database
The task to check battery level is configured to run after every 1 minute. All the schedules are stored in database
To run the app go to the project root director and run mvn spring-boot:run
command.
The command will launch the app and reload database with default drones.
After the project launch you can access the H2 database console in http://localhost:8080/api/h2-console
The application run in port 8080
with context URI /api/
i.e all endoints must start at {PORT NUMBER}/api/{OTHER ENDPOINTS}
E.g http://localhost:8080/api/drones
After project launching you can access SWAGGER API Documentation at http://localhost:8080/api/swagger-ui.html All swagger API endpoints contains descriptions on what it does just below it.
If you would prefer to use Postman for testing you can load the postman collection file stored in ROOT/src/main/resources/static/Musala.postman_collection.json
To access H2 console use the credentials provided in application.properties
URL: http://localhost:8080/api/h2-console
Except for {BASRE_URL}/drones/{DRONE-ID}/medications
endpoint for loading drone with medications which users Form Data all Other apis requires Application/Json.
All ENDPOINTS are tested and all working fine.