This commit is contained in:
@@ -34,5 +34,29 @@ namespace LaDOSE.Api.Controllers
|
||||
var stats = await _service.GetMatchStats(ids);
|
||||
return _mapper.Map<MatchStatsDTO>(stats);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The players a versus lookup can report on: everyone with at least one set in a
|
||||
/// bracket whose game is known, by display name. Not the application users —
|
||||
/// these are tournament players, the entities set rows point at.
|
||||
/// </summary>
|
||||
[HttpGet("Players")]
|
||||
public async Task<List<PlayerOptionDTO>> GetVersusPlayers()
|
||||
{
|
||||
var players = await _service.GetVersusPlayers();
|
||||
return _mapper.Map<List<PlayerOptionDTO>>(players);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Every recorded meeting between two players, across all events, split per game.
|
||||
/// Sets played in a bracket with no game attached are excluded and only counted in
|
||||
/// UnknownGameSets. Two identical or unknown ids return an empty breakdown, not an error.
|
||||
/// </summary>
|
||||
[HttpGet("Versus/{playerAId}/{playerBId}")]
|
||||
public async Task<PlayerVersusDTO> GetVersus(int playerAId, int playerBId)
|
||||
{
|
||||
var versus = await _service.GetVersus(playerAId, playerBId);
|
||||
return _mapper.Map<PlayerVersusDTO>(versus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user