Class PlayerController

java.lang.Object
com.fyp.tauceti.controller.PlayerController

@RestController public class PlayerController extends Object
Spring Controller for interacting with the PLAYER database table through web APIs
See Also:
  • Constructor Details

    • PlayerController

      public PlayerController(PlayerRepository repository)
      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

      @PostMapping("/update-player") public Player newPlayer(@RequestBody Player newPlayer)
      "/update-player" endpoint: Accepts POST requests
      Parameters:
      newPlayer - Player object to be added to database
      Returns:
      The Player object that was saved