The aim of this experiment project are management of campaigns for admin panel and calculate discounts using the campaigns.
This project has 5 API as below.
| Path | Method | Body Params | Request Params | Response | Description |
|---|---|---|---|---|---|
| /api/v1/campaigns | GET | Campaign | Returns all campaigns without any filter | ||
| /api/v1/campaigns | POST | Campaign | Campaign | Create a new campaign with given campaign details | |
| /api/v1/campaigns | PUT | Campaign | id | Campaign | Find campaign with given id and update that campaign |
| /api/v1/campaigns | DELETE | id | Campaign | Delete campaign with given campaign id | |
| /api/v1/campaigns/calculateDiscounts | POST | List<BasketItem> | List<BasketItem> | Calculate discounts with using campaign of category or product |
Create jar file with below maven command
mvn clean install
Build and run a docker image with below docker-compose command
docker-compose up -d --build
This experiment project is using Postgres for data model. There are two sql files under src/main/resources directory. Schema and tables can create with create_table.sql and initialize data can insert with insert_data.sql
This app runs on 8888 port.