This Spring Boot API collects some data from Spotify Web API and provides endpoints to sell albums and calculate cashback over every operation.
To build and run the project, use Gradle:
gradlew bootRunIf you feel the need to run this application without hitting Spotify API for test purposes, you can use the mock profile:
gradlew bootRun -Dspring.profiles.active=mockYou can also run the project in a Docker container:
gradlew docker
docker run -p 8080:8080 com.github.raphaelbluteau/cashbackGET /albums?genre=ROCK& size=10& page=1 HTTP/1.1
Host: localhost:8080
Content-Type: application/json
cache-control: no-cache
Postman-Token: 40550238-841f-4cc8-85a0-3d38960de3c6
GET /albums/545 HTTP/1.1
Host: localhost:8080
cache-control: no-cache
POST /orders HTTP/1.1
Host: localhost:8080
Content-Type: application/json
cache-control: no-cache
[
{
"id": 696
}
]
GET /orders/321 HTTP/1.1
Host: localhost:8080
cache-control: no-cache
GET /orders?begin=2019-01-01T01:30:00.000-02:00& end=2019-02-10T10:59:00.000-02:00& size=1& page=1 HTTP/1.1
Host: localhost:8080
cache-control: no-cache