Question: Week 7 Pair Exercises: Cat Cards Context Congratulations on your new job at HazBro. You'll be working on their latest project, Cat Cards. To facilitate
Week Pair Exercises: Cat Cards Context Congratulations on your new job at HazBro. You'll be working on their latest project, Cat Cards. To facilitate development, the VP in charge of this project split the development staff into three teams: Database, Frontend, and Backend. The VP placed you on the Backend team. The Frontend team developed their part of the application. However, they need you to provide the data so it works properly. They gave you the following API documentation: GET apicards: Provides a list of all Cat Cards in the user's collection. GET apicardsid: Provides a Cat Card with the given ID GET apicardsrandom: Provides a new, randomly created Cat Card containing information from the cat fact and picture services. POST apicards: Saves a card to the user's collection. PUT apicardsid: Updates a card in the user's collection. DELETE apicardsid: Removes a card from the user's collection. Cat Card JSON object structure Here's the JSON object structure for a Cat Card: "catCardId" : an integer that represents this particular card's unique identifier, "imgUrl" : "A string containing the full URL to the cat image", "catFact" : "A string containing a cat fact", "caption" : "A string containing the caption for this particular card" Cat Card collection example Here's an example collection of Cat Cards: "catCardId" : "imgUrl" : https:catdata.netlify.appimagesorangeandwhitecatsleepinginyellowblanketxjpg "catFact" : "Cats sleep of their lives.", "caption" : "Aww, this reminds me of Lefty! He slept CONSTANTLY." "catCardId" : "imgUrl" : https:catdata.netlify.appimagesgraycatwithgreeneyesxjpg "catFact" : "People who own cats have on average pets per household, whereas dog owners have about "caption" : "Bartender, I'll take a Salty Cat Once you provide implementation for those endpoints and return properly formatted JSON objects in the agreedupon schema, the application works. Hint: Consider starting with the controller method that provides a new, randomly created card. Database The Database team provided you with a script to create a local database and the DAO files to retrieve the data. You can implement your code without reviewing the implementation details of the DAO files. The interface provides you with enough information to complete your tasks. Cat data API There is a web API that provides you with random cat fact and cat picture data. You can use https:catdata.netlify.appapipicturesrandom to retrieve the URL of a random cat picture as a JSON object that looks like this: file:https:catdata.netlify.appimagescatwithbananasxjpg Make sure to implement the RestCatPicService to call this endpoint and return the data as a CatPic object. You can use https:catdata.netlify.appapifactsrandom to retrieve a random cat fact as a JSON object that looks like this: "status": "verified": true, "sentCount": "type": "cat", "deleted": false, id: fdced "user": aacceac "text": "A cat's tongue has tiny barbs on it "updatedAt": T::Z "createdAt": T::Zv: Make sure to implement the RestCatFactService to call this endpoint and return the data as a CatFact object. Getting started Create a new Postgres database called catcards. Run the script databasecatcardssql in pgAdmin to set up your database. Note: You'll see a message that says that the "catcards" table doesn't exist the first time you run the create script. You can ignore the message. Launch this project by running it as a Spring Boot application. In your browser, navigate to http:localhost: You'll see a page entitled "Welcome to Cat Cards." Initially, some items don't display properly on this page. As you implement the requirements of this exercise, return to the browser and refresh the page. The features of this page begin working.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
