feat(api): add channel state endpoint contract
This commit is contained in:
@@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user