Package com.fyp.tauceti.controller
Class PlayerController
java.lang.Object
com.fyp.tauceti.controller.PlayerController
Spring Controller for interacting with the PLAYER database table through web APIs
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
PlayerController
Paramaterised Constructor- Parameters:
repository
- PlayerRepository object for CRUD operations on LOGIN_RECORD database table
-
-
Method Details
-
allPlayers
@CrossOrigin(origins="http://localhost:4200") @GetMapping("/player") public List<Player> allPlayers()"/player" endpoint: Accepts GET requests- Returns:
- List of all Player records in database
-
newPlayer
"/update-player" endpoint: Accepts POST requests- Parameters:
newPlayer
- Player object to be added to database- Returns:
- The Player object that was saved
-