mySQL, Spring Boot, Spring data JPA
Constructor injection of service classes via their Interface
DTO classes, custom request/response classes
normalize api response with a custom class ApiResponse
Try ModelMapper instead of MapStruct
One product can have many images. Store image as blob. Have urls to download images.
API to search product from DB based on different queries:
- Get product by id using
@PathVariable - Get products by category, by brand using
@RequestParam - Get products by category AND brand,
Add product: If category not yet exist, create new category then add product to that category
Return product dto with image dto including image link and name
Create AddProductRequest & ProductUpdateRequest objects
- save & update image
- delete image
- get all image of a product
image is saved inside MySQL using blob data type
Basic crud apis
Each user can only have one cart. Cart information is stored inside Database to persist after user had log-out.
User can add [quantity] of an available item to their cart
One cart has multiple CartItem. Each CartItem is a Product
@RequestParamlà?brand=apple; case in-sensitive,Applehayappleboth ok;@PathVariablelàproduct/{productId}RequestBodylà raw json inside body
