raytotti / wishlist-support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wishlist Support API Microservice

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.

Requirements

To run this microservice, you will need the following:

Getting Started

To deploy and run the microservice in your Kubernetes, you will need to following these steps:

  1. Apply the ConfigMap Mongo located at ./deploy/kubernetes
     kubectl apply -f ./deploy/kubernetes/mongo-wl-sup-config.yml
  2. Apply the Secret Mongo located at ./deploy/kubernetes
     kubectl apply -f ./deploy/kubernetes/mongo-wl-sup-secret.yml
  3. Apply the Deployment Mongo located at ./deploy/kubernetes
    kubectl apply -f ./deploy/kubernetes/mongo-wl-sup-deployment.yml
  4. Apply the Deployment Api located at ./deploy/kubernetes
    kubectl apply -f ./deploy/kubernetes/deployment.yml

Endpoints

One of the options is to use the Swagger that is configured in the application at path /swagger-ui/index.html

Swagger

The following endpoints are available in the microservice:

Client

  • 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'

Product

  • 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'

TODO

  • 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.

About


Languages

Language:Java 99.6%Language:Dockerfile 0.4%