示例#1
0
 public IActionResult Login([FromBody] string username)
 {
     if (username?.Length > Limits.MAX_USERNAME)
     {
         throw new InputValueTooLargeException();
     }
     return(new JsonResult(ChessService.Login(PwdManService, GetToken(), username)));
 }
示例#2
0
 public IActionResult PlayAgainstComputer()
 {
     return(new JsonResult(ChessService.PlayAgainstComputer(GetTicket())));
 }
示例#3
0
 public IActionResult StartNewGame([FromBody] StartGameModel startGameModel)
 {
     return(new JsonResult(ChessService.StartNewGame(GetTicket(), startGameModel)));
 }
示例#4
0
 public IActionResult ConfirmNextGame([FromBody] bool ok)
 {
     return(new JsonResult(ChessService.ConfirmNextGame(GetTicket(), ok)));
 }
示例#5
0
 public IActionResult StartNextGame()
 {
     return(new JsonResult(ChessService.StartNextGame(GetTicket())));
 }
示例#6
0
 public IActionResult GetModel()
 {
     return(new JsonResult(ChessService.GetChessModel(GetTicket())));
 }
示例#7
0
 public IActionResult Logout()
 {
     return(new JsonResult(ChessService.Logout(GetTicket())));
 }
示例#8
0
 public IActionResult GetState()
 {
     return(new JsonResult(ChessService.GetState()));
 }
示例#9
0
 public IActionResult Place([FromBody] PlaceModel value)
 {
     return(new JsonResult(ChessService.Place(GetTicket(), value)));
 }
示例#10
0
 public IActionResult GiveUp()
 {
     return(new JsonResult(ChessService.GiveUp(GetTicket())));
 }
示例#11
0
 public IActionResult EndGame()
 {
     return(new JsonResult(ChessService.EndGame(GetTicket())));
 }