This is a sample Spring REST API project for managing sensors. It allows you to perform CRUD (Create, Read, Update, Delete) operations on sensor data.
Before running the project, ensure that you have the following installed:
- Java Development Kit (JDK) 8 or higher
- Apache Maven
- MySQL (optional, you can use an in-memory database like H2 for testing purposes)
- Clone the repository:
git clone https://github.com/denomelchenko/rest-api-sensor.git
- Navigate to the project directory:
cd RestApiProject
- Build the project using Maven:
mvn clean install
- Run the application:
mvn spring-boot:ru
- GET /sensors/ - Get all sensors.
- GET /sensors/{id} - Get sensor by id.
- POST /sensors/ - Add a new sensor.
- GET /sensors/{id}/measurements - Get all measurements for sensor by sensor id.
- GET /measurements/ - Get all measurements.
- GET /measurements/{id} - Get measurement by id.
- POST /measurements/ - Add a new measurement.
- GET /measurements/rainyDaysCount/ - Get count of rainy days.
- REST API
- Spring
- Hibernate
- Java Persistence API
- Validation of items
- MySQL - Relational database management system
- Maven - Build and dependency management tool
Contributions are welcome! If you find any issues or would like to add new features, please submit a pull request.
This project is licensed under the MIT License.