This microservice is responsible for maintaining the necessary information for the functioning of the Wishlist API microservice. It is built using Java 17, Spring Boot, Gradle and MongoDB, and is designed to be deployed using Kubernetes.
To run this microservice, you will need the following:
To deploy and run the microservice in your Kubernetes, you will need to following these steps:
- Apply the ConfigMap Mongo located at
./deploy/kubernetes
kubectl apply -f ./deploy/kubernetes/mongo-wl-sup-config.yml
- Apply the Secret Mongo located at
./deploy/kubernetes
kubectl apply -f ./deploy/kubernetes/mongo-wl-sup-secret.yml
- Apply the Deployment Mongo located at
./deploy/kubernetes
kubectl apply -f ./deploy/kubernetes/mongo-wl-sup-deployment.yml
- Apply the Deployment Api located at
./deploy/kubernetes
kubectl apply -f ./deploy/kubernetes/deployment.yml
One of the options is to use the Swagger that is configured in the application at path /swagger-ui/index.html
The following endpoints are available in the microservice:
- POST /api/v1/clients - Create a new client.
curl --location --request POST 'http://<applicationUrl>:<applicationPort>/api/v1/clients' \
--header 'Content-Type: application/json' \
--data-raw '{
"cpf": "164.565.990-91",
"name": "Jonh"
}'
- DELETE /api/v1/clients/{clientId} - Remove an informed clientId.
curl --location --request DELETE 'http://<applicationUrl>:<applicationPort>/api/v1/clients/<clientId>'
- GET /api/v1/clients/{clientId} - Retrieve an informed clientId.
curl --location --request GET 'http://<applicationUrl>:<applicationPort>/api/v1/clients/<clientId>'
- GET /api/v1/clients/{clientId}/exists - Checks if the informed client exists.
curl --location --request GET 'http://<applicationUrl>:<applicationPort>/api/v1/clients/<clientId>/exists'
- GET /api/v1/clients - Retrieve all clients.
curl --location --request GET 'http://<applicationUrl>:<applicationPort>/api/v1/clients'
- POST /api/v1/clients - Create a new product.
curl --location --request POST 'http://<applicationUrl>:<applicationPort>/api/v1/products' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "1",
"description": "Description product one",
"thumbnail": "url image",
"price": 20,
"category": "category product one",
"brand": "brand product one",
"additionalInfo": "more info about product one"
}'
- DELETE /api/v1/products/{productId} - Remove an informed product.
curl --location --request DELETE 'http://<applicationUrl>:<applicationPort>/api/v1/products/<productId>'
- GET /api/v1/products/{productId} - Retrieve an informed productId.
curl --location --request GET 'http://<applicationUrl>:<applicationPort>/api/v1/products/<productId>'
- GET /api/v1/products - Retrieve all products.
curl --location --request GET 'http://<applicationUrl>:<applicationPort>/api/v1/products'
- As a future implementation, we are going to implement the communication of this microservice with a messaging structure. with the intention of ensuring the integrity of product and customer data.