Jerkinator / secondRoll

0 stars 0 forks source link

88 update get game ads based on seller #97

Closed TeisLoyche closed 5 months ago

TeisLoyche commented 5 months ago

Added a GameResponseDTO and updated method for getting all game ads belonging to a user for better performance. Tested in postman, working on my end.

Try it for yourselves: http://localhost:8080/api/gameAds/user/:userId

Enter a user ID as path-variable and it should return a username and all games belonging to that username with all the corresponding game info.

I also updated the rest of the CRUD for gameads using the same GameResponseDTO to minimize the user info in the response to only return username in those aswell. (I'm aware this should have been a separate issue)!

You can test these out in postman aswell:

To POST a game ad: http://localhost:8080/api/gameAds use the following body: { "userId": "", "title": "", "description": "", "price": , "gameDetails": [""] }

to GET ALL games: http://localhost:8080/api/gameAds/all

to PUT (update) a game ad: http://localhost:8080/api/gameAds/:gameId Use the body from the GameAd you created and try changing a value.

to GET a game by it's ID: http://localhost:8080/api/gameAds/:id Enter a Game ID as path-variable.

to DELETE a game by it's ID: http://localhost:8080/api/gameAds/:id Enter a Game ID as path-variable.

Finally, roll the dice was also updated in the same way. It now only returns username, not all user info belonging to the game. http://localhost:8080/api/gameAds/rolldice

Hopefully it all works for you aswell! If so, we can merge.