- Clonar el Repositorio
git clone [email protected]:almsx/clients-generation.git
- Ejecutar el siguiente comando para poder levantar el API.
docker-compose up --build
En caso de que haya un error con MySQL, comparto las siguientes instrucciones.
- Ingresar a la Consola de MySQL usando Docker
docker exec -it mysql mysql -u root -p
Y se ejecutan los siguientes comandos:
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'appbuttons';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
exit;
- Reiniciar el Contenedor de MySQL
docker-compose down
docker-compose up -d
URL: http://localhost:8080/api/clients
Method: POST
Content-Type: application/json
Description: Este endpoint permite registrar un nuevo cliente en el sistema y devuelve la informaci贸n del cliente registrada.
Request Body:
{
"name": "Alberto",
"lastName": "Luebbert",
"email": "[email protected]",
"phone": "5511121314"
}
URL: http://localhost:8080/api/clients
Method: GET
Content-Type: application/json
Description: Este endpoint permite obtener todos los registros de clientes almacenados en BD.
URL: http://localhost:8080/api/clients/${id}
Method: GET
Content-Type: application/json
Description: Este endpoint permite obtener un cliente registrado en la base de datos.
URL: http://localhost:8080/api/clients/${id}
Method: PUT
Content-Type: application/json
Description: Este endpoint permite actualizar parcialmente un registro de un cliente existente.
Request Body:
{
"name": "Pedro",
"lastName": "L贸pez",
"email": "[email protected]",
"phone": "5512131415"
}
URL: http://localhost:8080/api/clients/${id}
Method: DELETE
Content-Type: application/json
Description: Este endpoint permite eliminar el registro de un cliente existente.
Happy Code 馃摤