A Java Spring Boot webservice to help collect pricing data from Target's RedSky API.
This project uses the following technologies:
- Java
- Spring Boot
- Mongo DB
There are two ways to interact with the data in this webservice.
- Submit a GET request to the following endpoint
localhost:8080/products/{productId}
Where theproductId
is one of a few configured id's. These include: 13860428, 54456119, 13264003, 12954218. - Submit a PUT request to the following endpoing
localhost:8080/products/{productId}
Where theproductId
is one of a few configured id's. These include: 13860428, 54456119, 13264003, 12954218. AND including a payload describing the produce with updated pricing information. Here is a example of this PUT request using curl:curl -i -X PUT -H 'Content-Type: application/json' -d '{"_id": 12954218, "currentPrice": {"value": 17.29, "currencyCode": "USD"}}' http://localhost:8080/products/12954218
It is also backed by a local instance of MongoDB. MongoDB needs to be setup prior in the following ways:
- Create a "price" collection
- Create four documents in this collection:
{ "_id": 13860428, "value": 4.29, "countryCode": "USD" }
{ "_id": 54456119, "value": 6.29, "countryCode": "USD" }
{ "_id": 13264003, "value": 3.59, "countryCode": "USD" }
{ "_id": 12954218, "value": 5.99, "countryCode": "USD" }
Since MongoDB is running locally, make sure to start it before trying to run this application, otherwise it will fail with connection errors.