This is the backend of canteen application.
This project made with a team of 6 interns.
Using Rest API, Spring Boot, MongoDB, Docker, RabbitMQ.
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.
-
localhost:8081/api/Product/createProduct
{ "productName" : "Espresso, "productPrice" : 5 }
Other parameters gets set by null if it is not given.
- localhost:8081/api/Product/listProducts
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 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
-
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, }
- localhost:8081/api/Product/sortByType/{productType}
- localhost:8081/api/Product/deleteProduct/{productId}
Deletes the product from the database with DELETE mapping.
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.
- localhost:8081/api/Product/updateProduct/{productId}
Updates the product after changing its values.
-Implemented Swagger Documentation, wrote the explanation of ProductController requests. To see the documentation head over to the http://localhost:8080/swagger-ui/index.html#