Spaces:
Runtime error
Runtime error
Download src/SCM.Api/Controllers/CaracteristicasController.cs from rafaeldavila/scm-api: direct link, hf CLI and curl.
- Browser
- Download file 5.05 kB
-
https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/src/SCM.Api/Controllers/CaracteristicasController.cs
- Command line
-
hf download hf://spaces/rafaeldavila/scm-api/src/SCM.Api/Controllers/CaracteristicasController.cs
-
curl -L -o CaracteristicasController.cs https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/src/SCM.Api/Controllers/CaracteristicasController.cs
5.05 kB
| using Asp.Versioning; | |
| using Microsoft.AspNetCore.Authorization; | |
| using Microsoft.AspNetCore.Mvc; | |
| using SCM.Application.Controle; | |
| using SCM.Shared.Api; | |
| using SCM.Shared.Constants; | |
| namespace SCM.Api.Controllers; | |
| /// <summary>Características do IC (filtro/projeto) e foto do acompanhamento agrupada por filtro.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public sealed class CaracteristicasController : ControllerBase | |
| { | |
| private readonly ICaracteristicaService _service; | |
| public CaracteristicasController(ICaracteristicaService service) => _service = service; | |
| /// <summary>Lista as características da obra.</summary> | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<IReadOnlyList<CaracteristicaResponse>>> GetByObra( | |
| Guid obraId, CancellationToken ct = default) | |
| => Ok(await _service.GetByObraAsync(obraId, ct)); | |
| /// <summary>Cria uma característica (nome único por obra; Projeto exige numérica).</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<CaracteristicaResponse>> Create( | |
| [] CreateCaracteristicaRequest request, CancellationToken ct = default) | |
| => Ok(await _service.CreateAsync(request, ct)); | |
| /// <summary>Exclui uma característica sem valores em ICs.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<IActionResult> Delete(Guid id, CancellationToken ct = default) | |
| { | |
| await _service.DeleteAsync(id, ct); | |
| return NoContent(); | |
| } | |
| /// <summary>Valores das características de um IC.</summary> | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<IReadOnlyList<ValorIcResponse>>> GetValores( | |
| Guid itemControleId, CancellationToken ct = default) | |
| => Ok(await _service.GetValoresDoIcAsync(itemControleId, ct)); | |
| /// <summary>Define (upsert) o valor de uma característica no IC.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<ValorIcResponse>> DefinirValor( | |
| Guid itemControleId, [FromBody] DefinirValorRequest request, CancellationToken ct = default) | |
| => Ok(await _service.DefinirValorAsync(itemControleId, request, ct)); | |
| /// <summary>Remove o valor de uma característica do IC.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<IActionResult> RemoverValor( | |
| Guid itemControleId, Guid caracteristicaId, CancellationToken ct = default) | |
| { | |
| await _service.RemoverValorAsync(itemControleId, caracteristicaId, ct); | |
| return NoContent(); | |
| } | |
| /// <summary>Foto do acompanhamento agrupada por valor da característica de filtro (DIFF_FILTER_CARACS → 400).</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<IReadOnlyList<FotoPorFiltroResponse>>> GetFotoPorFiltro( | |
| Guid obraId, [FromQuery] DateOnly data, CancellationToken ct = default) | |
| => Ok(await _service.GetFotoPorFiltroAsync(obraId, data, ct)); | |
| } | |