Git Product home page Git Product logo

cloth-ecommerce's Introduction

About

  • Clothing Product API with Spring Boot MVC

Environment:

  • Java version: 17
  • Maven version: 4.*
  • Spring Boot version: 3.3.2.RELEASE

Read-Only Files:

  • src/test/*

Data:

Example of a weather data JSON object:

{
   "barcode": "74002423",
   "item": "Shawl",
   "category": "Accessories",
   "price": 758,
   "discount": 12,
   "available": 1
}

Requirements:

The REST service must expose the /products endpoint, which allows for managing the collection of weather records in the following way:

POST request to /products:

  • creates a new list of product data records
  • expects a product data object as its body payload, and verify before creating an object
  • the response code is 201 and the response body is the created record and returns a list of the products

GET request to /sort/items:

  • the response code is 200
  • the response body is an array of matching records, ordered by their price in increasing order
  • accepts an optional query string parameter, item, and when this parameter is present, only the records with the matching items are returned. The value of this parameter is case insensitive, so "jackets" and "Jackets" are equivalent. Moreover, it might contain several values, separated by commas (e.g. item=pants,jacket), meaning that records with the item matching any of these values must be returned.
  • accepts an optional query string parameter, sort, that can take one of two values: either "asc" or "desc". If the value is "asc", then the ordering is by price in ascending order. If it is "desc", then the ordering is by price in descending order. If there are two records with the same date, the one with the cheaper id must come first.

GET request to /filter/price/<initial_price}>/<final_price}>:

  • returns a list of records within given price range of initial_price and final_price
  • if the matching record exists, the response code is 200 and the response body is the matching object list
  • if there is no record in the collection with the given price range, the response code is 404

GET request to /sort/price:

  • returns an array of records sorted by prices
  • if the matching record exists, the response code is 200 and the response body is the matching object list
  • if there is no record in the collection with the response code is 404

Commands

  • run:
mvn spring-boot:run
  • install:
mvn clean install
  • test:
mvn clean test

cloth-ecommerce's People

Contributors

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