GithubHelp home page GithubHelp logo

aliarmgnuygun / baum-stock-backend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eneskasikci/stock-backend

0.0 0.0 0.0 45 KB

This project is the backend of the Canteen application for Anadolu University Computer Research and Application Center

Java 99.48% Shell 0.52%

baum-stock-backend's Introduction

Introduction

This is the backend of canteen application.

This project made with a team of 6 interns.

Using Rest API, Spring Boot, MongoDB, Docker, RabbitMQ.

Docker Setup

Start the terminal in the project directory. Start the containers by "docker-compose up".

In Postman connect to "localhost:8081/api/Product/{ WRITE_MAPPINGS_HERE }" to test the functions.

Mappings

POST Mappings

createProduct: Adds a product to the database in JSON format

  • localhost:8081/api/Product/createProduct

      {
          "productName" : "Espresso,
          "productPrice" : 5
      }
    

Other parameters gets set by null if it is not given.

GET Mappings

listProducts: List every product that is on the database.

  • localhost:8081/api/Product/listProducts

Listing products by their availability.

When products are added, they are available by default and will be listed to purchase.

  • Returns products that are available.

    • localhost:8081/api/Product/listAvailableProducts
  • This returns products that are not available.

    • localhost:8081/api/Product/listNotAvailableProducts

Sorting products given their name or prices

  • Sorting product prices, names ascending or descending
    • localhost:8081/api/Product/sortByPriceAsc
    • localhost:8081/api/Product/sortByPriceDesc
    • localhost:8081/api/Product/sortByNameAsc
    • localhost:8081/api/Product/sortByNameDesc

Listing a product If it is exist with the ID

  • localhost:8081/api/Product/URUN_{replaceThisWithANumber}

    Ex. localhost:8081/api/Product/URUN_1
    
      {
          "productId": "URUN_1",
          "productName": "Espresso",
          "productPrice": 3.0,
          "productCategory": "ICECEK",
          "productType": "SOGUK",
          "productImage": null,
          "availability": true,
      }         
    

Listing the products with their type

  • localhost:8081/api/Product/sortByType/{productType}

Delete Mappings

  • localhost:8081/api/Product/deleteProduct/{productId}

Deletes the product from the database with DELETE mapping.

Put Mappings

Changing availability of the product.

If the product not available it shouldn't be purchasable. So the admin should change the availability of the product.

  • localhost:8081/api/Product/{productId}/availability

This changes the state of the availability of the product. If the product is available it makes it not available and vice-versa.

Updating the product details

  • localhost:8081/api/Product/updateProduct/{productId}

Updates the product after changing its values.

Swagger

-Implemented Swagger Documentation, wrote the explanation of ProductController requests. To see the documentation head over to the http://localhost:8080/swagger-ui/index.html#

baum-stock-backend's People

Contributors

eneskasikci avatar aliarmgnuygun avatar sakinek avatar dilekkocaturk avatar s-kizilkaya 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.