The main idea behind this is to have a ready-to-go class as a base to use it as an API. In this case, I decided to just create one class (Product), so it can be something simple but easy to modify, giving us a good starting point for our project.
GET /products/get/all
Description |
---|
Returns all the products from the database. |
GET /products/get/{id}
Description |
---|
{id} represents the product ID to get |
POST /products/new
Description |
---|
It uses a RequestBody, so you have to pass a product when calling the function. |
PUT /products/edit/{id}
Description |
---|
{id} represents the product ID to edit |
It uses a RequestBody, so you have to pass a product when calling the function. |
DELETE /products/delete/{id}
Description |
---|
{id} represents the product ID to delete |