Code Monkey home page Code Monkey logo

product-management-api's Introduction

Product Management API

This project implements a RESTful API for managing product details and products. It provides endpoints to perform CRUD operations on product details and retrieve product information.

Prerequisites

  • Java 8+
  • Maven

Features

  1. Insert Product

    • Method: (POST)
    • Endpoint: /api/products
    • Request Body: ProductDetails JSON object
    • Response: ProductDetails JSON object
    • Example Request Body:
    {
    "name": "",
    "expirationDate": "2078-12-02",
    "manufacturer": "",
    "price": 10.5,
    "available": true
    }
     
    
  2. Update productDetails:

    • Method: PUT
    • Endpoint: /api/products
    • Request Body: ProductDetails JSON object
    • Response: ProductDetails JSON object
    • Example Request Body:
    {
    "id":
    "name": "",
    "expirationDate": "2078-12-02",
    "manufacturer": "",
    "price": 10.5,
    "available": true
    }
     
    
  3. **Delete Product **:

    • Method: DELETE
    • Endpoint: /api/products?id=
    • Path Variable: ID of the product to delete
  4. Get Product Details by ID:

    • Method: GET
    • Endpoint: /api/products/productDetailsById?id=
    • Path Variable: ID of the product to retrieve
    • Response: ProductDetails JSON object
  5. Get Product Details by Name:

    • Method: GET
    • Endpoint: /api/products/productDetailsByName?searchKey=
    • Query Parameter: Name of the product to retrieve
    • Response: ProductDetails JSON object
  6. Get All Products:

    • Method: GET
    • Endpoint: /api/products
    • Response: List of Product JSON objects
  7. Get Product by ID:

    • Method: GET
    • Endpoint: /api/products/productById?id=
    • Path Variable: ID of the product to retrieve
    • Response: Product JSON object

Documentation

The APIs are documented using Swagger. You can access the Swagger UI by navigating to /swagger-ui.html after starting the application. swagger

Postman Collection

A Postman collection containing requests for each EndPoint , import this collection into Postman to test the APIs. post

Testing

Test cases are written using RestTemplate to ensure the functionality of the API.

1 test

Interacting with the API

You can interact with the API using any REST client or HTTP testing tool. The API uses JSON for request and response data(Jakson).

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.16.1</version>
    </dependency>
    
    
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.16.1</version>
    </dependency>

product-management-api's People

Contributors

salma-4 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.