This API allows you to manage people. In this project you can add people and addresses to them. You can also specify which is the main address of a person.
You can use the Swagger to manipulate the endpoints: localhost:8080/swagger-ui.html
It was used these technologies in this project.
You will need these tools installed in your machine:
- It Must have Git installed
- At least it has Java 17 installed
- It Must have Maven installed
# Clone this repository
git clone https://github.com/yesminmarie/people-management
# Go into the folder of the project
cd people-management
# execute the project
./mvn spring-boot:run
- POST - localhost:8080/persons (Add a new person)
Example:
{
"name": "Maria",
"birthDate": "11/11/1990"
}
-
GET - localhost:8080/persons/{id} (Get the person by id)
-
GET - localhost:8080/persons (Get all persons using pagination)
Example: localhost:8080/persons?page=0&size=2
- PUT - localhost:8080/persons/{id} (Update a specific person)
Example:
{
"name": "Ana",
"birthDate": "11/11/2001"
}
-
GET - localhost:8080/addresses/{idPerson} (Get the addresses of a specific person, passing the person id)
-
POST - localhost:8080/addresses (Save a new address to a specific person)
Example:
{
"street": "Rua Teste",
"zipCode": "123456789",
"number": 123,
"city": "São Paulo",
"idPerson": 1,
"main": true
}
- PATCH - localhost:8080/addresses/{idAdress} (Update the main address of a person, passing the address id that will be the main address)