java – Rest Controller in Spring Boot for REST API from Rock Paper Scissors

I've created a Microservice Spring Boot to play Rock Paper Scissors. I've tried to follow best practices, but I would still appreciate a review of my code. Thank you.

@RestController
Public class RockPaperScissorsController {

@Autowired
playerService playerPrivate service;

@Autowired
private context HttpServletRequest;

@Autowired
GameSessionService private gameSessionService;

@Autowired
GameplayPrivate service gameplayService;

public RockPaperScissorsController (PlayerService playerService,
GameSessionService gameSessionService) {
this.playerService = playerService;
this.gameSessionService = gameSessionService;
}

@GetMapping (value = "/ ping", product = "application / json")
public ResponseEntity ping () {
return ResponseEntity.ok ("{" response  ": " pong  "}");
}

@GetMapping (value = "/ player / {playerName}", product = "application / json")
public ResponseEntity drive (@PathVariable ("playerName") String playerName) {
try {
Player player = playerService.getPlayer (playerName);
return ResponseEntity.ok (reader);
} catch (RPSException e) {
return ResponseEntity.badRequest (). body (e.getMessage ());
}
}

@PostMapping (value = "/ player / {playerName}", product = "application / json")
public ResponseEntity playerPOST (@PathVariable ("playerName") String playerName) {
try {
playerService.createPlayer (playerName);
returns ResponseEntity.ok (). body ("");
} catch (RPSException e) {
return ResponseEntity.badRequest (). body (e.getMessage ());
}
}


@DeleteMapping (value = "/ player / {playerName}", product = "application / json")
public ResponseEntity playerDELETE (@PathVariable ("playerName") String PlayerName) {
try {
playerService.deletePlayer (playerName);
returns ResponseEntity.ok ("");
} catch (RPSException e) {
return ResponseEntity.badRequest (). body (e.getMessage ());
}
}

@PostMapping (value = "/ createInvite / {playerName}", product = "application / json")
public ResponseEntity createInvite (@PathVariable ("playerName") String invite) {
try {
Player player = playerService.getPlayer (invite);
GameSession session = gameSessionService.createSessionFrom (new Prompt (player));
return ResponseEntity.ok (session);
} catch (RPSException e) {
return ResponseEntity.badRequest (). body (e.getMessage ());
}
}

@PostMapping (value = "/ acceptInvite / {promptCode} / {playerName}", product = "application / json")
public ResponseEntity acceptInvite (@PathVariable ("promptCode") String promptCode,
@PathVariable ("playerName") String playerName) throws InvalidOperationException {
try {
Player player = playerService.getPlayer (playerName);
return ResponseEntity.ok (gameSessionService.acceptInvite (drive, promptCode));
} catch (RPSException e) {
return ResponseEntity.badRequest (). body (e.getMessage ());
}
}

@GetMapping (value = "/ session / {promptCode}", product = "application / json")
public session ResponseEntity (@PathVariable ("promptCode") String promptCode) {
return ResponseEntity.ok (gameSessionService.sessions (). get (promptCode));
}

@PostMapping (value = "/ readyplayer / {playername}", product = "application / json")
public ResponseEntity ready (@PathVariable ("playername") String playerName) {
try {
Player player = playerService.changePlayerState (playerName, Player.State.READY);
return ResponseEntity.ok (reader);
} catch (RPSException e) {
return ResponseEntity.badRequest (). body (e.getMessage ());
}
}

@PostMapping (value = "/ play", product = "application / json")
Public ResponseEntity play (@RequestBody PlayRequest playRequest) {
try {
gameplayService.play (playRequest);
returns ResponseEntity.ok (). body ("");
} catch (RPSException e) {
e.printStackTrace ();
}
return ResponseEntity.status (HttpStatus.NOT_IMPLEMENTED) .body ("");
}

}