adding despesas e receitas
This commit is contained in:
@@ -22,6 +22,11 @@ namespace OpenCand.API.Controllers
|
||||
[EnableRateLimiting(RateLimitingConfig.CandidatoSearchPolicy)]
|
||||
public async Task<CandidatoSearchResult> CandidatoSearch([FromQuery] string q)
|
||||
{
|
||||
if (string.IsNullOrEmpty(q) || q.Length == 1)
|
||||
{
|
||||
throw new ArgumentException("Query parameter 'q' cannot be null/empty.", nameof(q));
|
||||
}
|
||||
|
||||
return await openCandService.SearchCandidatosAsync(q);
|
||||
}
|
||||
|
||||
@@ -52,5 +57,17 @@ namespace OpenCand.API.Controllers
|
||||
await Task.Delay(randomWait);
|
||||
return await openCandService.GetCandidatoCpfById(id);
|
||||
}
|
||||
|
||||
[HttpGet("{id}/despesas")]
|
||||
public async Task<DespesasResult> GetCandidatoDespesas([FromRoute] Guid id)
|
||||
{
|
||||
return await openCandService.GetDespesasByIdAndYear(id);
|
||||
}
|
||||
|
||||
[HttpGet("{id}/receitas")]
|
||||
public async Task<ReceitaResult> GetCandidatoReceitas([FromRoute] Guid id)
|
||||
{
|
||||
return await openCandService.GetReceitasByIdAndYear(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user