SpringPatterns is an API designed to test object-oriented design patterns using Spring Boot.
- Java: Version 17
- Spring Boot
- Spring Web
- Spring Data JPA
- H2 Database
- OpenFeign
- OpenAPI
- Customer Registration API: Automatically fills in the address based on the postal code using the viaCep API available at https://viacep.com.br/.
- Java 17
- Maven or Gradle
Ensure you have the following installed:
- Java 17
- Maven or Gradle
- Clone the Repository
git clone <repository_url> cd SpringPatterns
- Build the Project
Using Maven:
mvn clean install
Using Gradle:
./gradlew build
- Run the Application
Using Maven:
mvn spring-boot:run
Using Gradle:
./gradlew bootRun
API Endpoints Customer Registration
Get /customers
Registers a new customer and automatically fills in the address using the viaCep API.
Example request body:
URL: viacep.com.br/ws/01001000/json/
Example response:
json
{
"cep": "01001-000",
"logradouro": "Praça da Sé",
"complemento": "lado ímpar",
"unidade": "",
"bairro": "Sé",
"localidade": "São Paulo",
"uf": "SP",
"ibge": "3550308",
"gia": "1004",
"ddd": "11",
"siafi": "7107"
}