- Java 17
- Maven
- Spring Boot Starter Web
- Redis
- Jedis
- Lombok
Welcome to the Product API! This API allows you to perform CRUD (Create, Read, Update, Delete) operations on product entities.
-
Home
- URL:
/
- Method: GET
- Description: Retrieve a welcome message for the Product API.
- URL:
-
Save Product
- URL:
/products/save
- Method: POST
- Request Body: Product object in JSON format
- Description: Save a new product.
- URL:
-
Get All Products
- URL:
/products/getAll
- Method: GET
- Description: Retrieve a list of all products.
- URL:
-
Get Product by ID
- URL:
/products/getById/{productId}
- Method: GET
- Path Variable:
productId
- ID of the product to retrieve - Description: Retrieve product details by ID.
- URL:
-
Remove Product
- URL:
/products/remove/{productId}
- Method: DELETE
- Path Variable:
productId
- ID of the product to remove - Description: Remove a product by ID.
- URL:
-
Save Product, Get Product by ID:
- Success Response: Product object in JSON format
- Error Response: Error message in case of failure
-
Get All Products:
- Success Response: List of Product objects in JSON format
- Error Response: Error message in case of failure
-
Remove Product:
- Success Response: None
- Error Response: Error message in case of failure
- All error responses include an error message that provides information about the issue.
-
Save Product
POST /products/save Request Body: { "id": 1, "name": "Product Name", "price": 19.99, "quantity": 50 }
-
Get All Products
GET /products/getAll
-
Get Product by ID
GET /products/getById/1
-
Remove Product
DELETE /products/remove/1
Feel free to customize the base URL and add any additional details or constraints specific to your application requirements.