ra-eng / JavaGirls

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🚀 Wishlist 🚀

In this project we create an e-commerce's Wishlist using API Spring boot and git and swagger.

✔️ Table of contents

✔️ Features

  • SWAGGER with endpoints access
  • Client Register
  • Product Register
  • Add product in Client's wishlist
  • Remove product in Client's wishlist
  • Consult all products of Client's wishlist
  • Consult if a determined product is in Client's wishlist

✔️ Installation

🛠 Technologies and Dependencies

▶️ How to use this repository

$ git clone git@github.com:ra-eng/JavaGirls.git
  • Open the project in the Editor
  • After that you can RUN

▶️ Usage

✔️ Add new Client

Input: POST:"/clients"

{
  "cpf": "123.456.789-10", 
  "email": "email@gmail.com",
  "name": "Name",
  "password": "password"   
}

✔️ Add new Product

Input: POST:"/products"

{
  "name": "Name ,
  "price": $20,
  "details": "details",
  "category": "category",
  "image": "image"
}

✔️ Fetch all products

Input: GET:"/products"

[
     "id": 1,
     "name": "cadeira",
     "price": 200,
     "details": "details",
     "category": "sala",
     "image": "cadeira.png"
   },
   {
     "id": 3,
     "name": "cadeira gamer",
     "price": 900,
     "details": "details",
     "category": "sala",
     "image": "cadeira.png"
   },
   {
     "id": 5,
     "name": "iphone",
     "price": 10000,
     "details": "details",
     "category": "telefonia",
     "image": "iphone.png"
   },
   {
     "id": 9,
     "name": "calça",
     "price": 5,
     "details": "details",
     "category": "vestimenta",
     "image": "bbb.png"
   }
]

✔️ Search a wishlist for a given client id

GET:"/wishlist/{clientId}"

[
      "id": 1,
      "name": "cadeira",
      "price": 200,
      "details": "details",
      "category": "sala",
      "image": "cadeira.png"
    },
    {
      "id": 3,
      "name": "cadeira gamer",
      "price": 900,
      "details": "details",
      "category": "sala",
      "image": "cadeira.png"
    }
]

✔️ Add a product to the client's wishlist

Post:"/wishlist/{clientId}/{productId}" Link clientId to productId

{
  "id": 1,
  "cpf": "123.456.789-00",
  "name": "Alexa",
  "email": "email@gmail.com",
  "password": "password",
  "products":[
      "id": 1,
      "name": "cadeira",
      "price": 200,
      "details": "details",
      "category": "sala",
      "image": "cadeira.png"
    },
    {
      "id": 3,
      "name": "cadeira gamer",
      "price": 900,
      "details": "details",
      "category": "sala",
      "image": "cadeira.png"
    }
  ]
}

✔️ Deletes a product in client's wishlist

Deletes a product in client's wishlist by id Input: DELETE:"/wishlist/{clientId}/{productId}"

"Product removed.Parabens"

✔️ Search a product by name

Input: POST:"/wishlist/{clientId}/product/{name}"

{
  "id": 1,
  "cpf": "123.456.789-00",
  "name": "Alexa",
  "email": "email@gmail.com",
  "password": "password",
  "products": [
      "id": 9,
      "name": "calça",
      "price": 5,
      "details": "details",
      "category": "vestimenta",
      "image": "bbb.png"
    ]
}

About


Languages

Language:Java 100.0%