Use the following command to start the application:
gradlew bootRun
Once the application is started the following can be accessed:
-
Swagger UI can be accessed from here:
-
Grafana/Loki can be accessed from here:
To get the log level for the application, the following actuator endpoint can be used:
curl http://localhost:8080/actuator/loggers/com.cyanice.shop
To change the log level for the application, the following command can be used:
curl -i -X POST -H 'Content-Type: application/json' -d '{"configuredLevel": "TRACE"}' http://localhost:8080/actuator/loggers/com.cyanice.shop
Postman collection export for this project can be found here:
extra/shop_postman_collection.json
Use the following command to run all the test cases:
gradlew test
The html test report is generated in the following folder:
build/reports/tests/test/index.html
-
Return the wish list of a customer:
http://localhost:8080/api/customer/:id/wishlist?pageNo=0&pageSize=10
-
Return the total sale amount of the current day:
-
Return the max sale day of a certain time range:
http://localhost:8080/api/order/max-sale-date?from=2024-04-20&to=2024-04-21
-
Return top 5 selling items of all time (based on total sale amount):
http://localhost:8080/api/order/popular-products?duration=All&category=Amount
-
Return top 5 selling items of the last month (based on number of sales):
http://localhost:8080/api/order/popular-products?duration=LastMonth&category=Count
** All the date (yyyy-MM-dd) value for input are considered to be in UTC