BeerFactory is an API that handles 4 endpoints.
GET Endpoint for fetching all beer records from database.
GET Endpoint for getting one beer record with specified ID.
DELETE Endpoint for deleting beer record with specified ID.
POST Endpoint for inserting beer record from another API using RestTemplate.
curl http://localhost:8080/beers/
-H "Accept: application/json"
curl http://localhost:8080/beers/{id}
-H "Accept: application/json"
curl -X POST http://localhost:8080/beers/
curl -X DELETE http://localhost:8080/beers/{id}
I chose to work with MySQL database, because I wanted to take some challenge for myself. In my earlier projects I was using in memory database like H2, and that is why I decided to use MySQL and gain some new knowledge and experience. Also, I wanted to use streams from Java 8 and learn them as much as possible.
For my second time around, I would add Unit table to database to reduce redundant fields.
Also, I would implement search, paging and sorting for application.
Also, I would do pairing good beers with provided food, and this would also make database a bit different.