- use Validation I/O at car model
- GET all the cars
- POST a car
- DELETE a car by id
- GET a car by id
- UPDATE a car by id
a project based on another project on my github, which is: cars_api_java and ModelaAí, I chose to make it it separately for educational purposes. The goal of this part of the project was to create the services folder and use controllers to send http status and communicate with services and services to communicate with the repository. In this part of the project I used the Validation I/O to validate the Car model.
To clone the project, run the following command:
git clone https://github.com/NinaS23/Crud_Lover_JAVA.git
Then navigate to the project file in ApiApplication.java and:
run the project
the url used is
http://localhost:8080/api/cars
{
"modelo": "Fiat Argo 1.3",
"fabricante": "Fiat",
"dataFabricacao": "2006-10-02",
"valor": 10.000,
"anoModelo": 2023
}
just need to use this url after a POST
http://localhost:8080/api/cars
replace the id in this url with the id of the car you want to get
http://localhost:8080/api/cars/{id}
replace the id in this url with the id of the car you want to delete
http://localhost:8080/api/cars/{id}
replace the id in this url with the id of the car you want to update
http://localhost:8080/api/cars/{id}