Giter Site home page Giter Site logo

wishlist's Introduction

Wishlist

Descrição do Projeto

Projeto Lista de desejos do cliente

Funcionalidades Principais:

  • Adicionar um produto na Wishlist do cliente;
  • Remover um produto da Wishlist do cliente;
  • Consultar todos os produtos da Wishlist do cliente;
  • Consultar se um determinado produto está na Wishlist do cliente;

Tecnologias Utilizadas:

Java 17 Spring Boot 3+ MongoDB Testcontainers

Requisitos do Sistema

Java 17 Docker ...

Como executar o projeto?

é necessario possuir java17+ e docker

build: ./gradlew clean build

Avisos: antes de iniciar o projeto faça: doker-compose up

Documentação

A documentação reativa do swagger-ui está disponivel em:

http://localhost:8080/swagger-ui/index.html
Endpoints da API

Listar

Método: GET URL: GET /wishlist/listProductsByCustomer?customer=customer Content-Type: application/json

CURL

curl --location 'http://localhost:8080/wishlist/listProductsByCustomer?customer=customer'

RESPONSE:

{"products":["awesome product"]}

quando a lista é vazia o status de retorno é NOT_FOUND 404 quando a lista possui itens o retorno é SUCESSO 200


Adicionar

Método: GET URL: GET /wishlist/listProductsByCustomer?customer=customer Content-Type: application/json

CURL

curl --location 'http://localhost:8080/wishlist' \
--header 'asdadas: qwewqeq' \
--header 'wswss: sassa' \
--header 'Content-Type: application/json' \
--data '{
    "product": "awesome product",
    "customer": "awesome customer"
}'

RESPONSE:

{"id": "85f86c74-e2a5-4e34-9ea8-eac6a6c70b53"}

SUCESSO 200

REMOVER

Método: DELETE URL: DELETE /wishlist Content-Type: application/json

CURL

curl --location --request DELETE 'http://localhost:8080/wishlist' \
--header 'Content-Type: application/json' \
--data '{
    "product": "a",
    "customer": "a"
}'

RESPONSE:

{ "isRemoved": true}

isRemoved retorna true quando um produto foi encontrado. e false quando não houve correspôndencia SUCESSO 200

BUSCAR

Método: GET URL: GET /wishlist/isProductInCustomerWishlist Content-Type: application/json

CURL

curl --location --request GET 'http://localhost:8080/wishlist/isProductInCustomerWishlist?customer=awesome%20customer&product=awesome%20product' \
--header 'Content-Type: application/json' \
--data '{
    "customer": "a",
    "product": "z"
}'

RESPONSE: quando o produto está cadastrado: SUCESSO 200

{"isProductPresent": true}

quando o produto não foi encontrado: SUCESSO 404

{"isProductPresent": false}

Leituras sugeridas: https://martinfowler.com/bliki/ValueObject.html https://blog.cleancoder.com/uncle-bob/2011/09/30/Screaming-Architecture.html https://www.baeldung.com/spring-boot-clean-architecture

wishlist's People

Contributors

megalexandre avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.