Finalisation endpoints

This commit is contained in:
2025-11-13 15:11:34 +01:00
parent 5c12a45ae6
commit 3a09bfc8ad
20 changed files with 922 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
using PyroFetes.DTO.SoundTimecode.Response;
namespace PyroFetes.Endpoints.SoundTimecode;
public class GetAllSoundTimecodesEndpoint(PyroFetesDbContext pyroFetesDbContext) : EndpointWithoutRequest<List<ReadSoundTimecodeDto>>
{
public override void Configure()
{
Get("/api/soundtimecodes");
AllowAnonymous();
}
public override async Task HandleAsync(CancellationToken ct)
{
var soundTimecodes = await pyroFetesDbContext.SoundTimecodes
.Select(st => new ReadSoundTimecodeDto
{
ShowId = st.ShowId,
SoundId = st.SoundId,
Start = (int)st.Start,
End = (int)st.End
})
.ToListAsync(ct);
await Send.OkAsync(soundTimecodes, ct);
}
}