public async Task <IActionResult> PostAttack([FromBody] StartAttackDto startAttackDto) { if (!ModelState.IsValid) { return(BadRequest()); } var userId = int.Parse(HttpContext.User.Identity.Name); await _armyService.AttackCity(userId, startAttackDto); return(Ok()); }
public async Task <IActionResult> PostAttack(int playerId, [FromBody] StartAttackDto startAttackDto) { var player = await _playerService.GetPlayerAsync(playerId); if (player == null) { return(NotFound()); } await _armyService.AttackCity(player.UserId, startAttackDto); return(Ok()); }