feat(api): add channel state endpoint contract

This commit is contained in:
2026-07-02 19:29:59 +02:00
parent 1891498563
commit 7c1a1d5672
5 changed files with 50 additions and 0 deletions
@@ -21,6 +21,18 @@ public class ChannelController(ChannelWriter<IBackgroundServiceRequest> workerCh
[EndpointGroupName("general")]
public async Task<List<ChannelResponseModel>> GetAll() => await mediator.Send(new GetAllChannelsForApi());
[HttpGet("/api/channels/state")]
[Tags("Channels")]
[EndpointSummary("Get channel runtime state")]
[EndpointGroupName("general")]
[ProducesResponseType(typeof(List<ChannelStateResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetState(CancellationToken cancellationToken)
{
List<ChannelStateResponseModel> result =
await mediator.Send(new GetChannelStatesForApi(), cancellationToken);
return new OkObjectResult(result);
}
[HttpGet("/api/channels/{id:int}", Name = "GetChannelById")]
[Tags("Channels")]
[EndpointSummary("Get a channel by id")]