| 12345678910111213141516171819202122232425262728293031 |
- using Web.Api.Common;
- using Web.Api.Extensions;
- using Application.Abstractions.Messaging;
- namespace Web.Api.Endpoints.Channel;
- /// <summary>라이브 방송 중인 채널 목록 (메인 페이지용, 페이지네이션 지원)</summary>
- internal sealed class LiveList : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/channel/live-list", async (
- ISender sender,
- CancellationToken ct,
- int limit = 24,
- int offset = 0,
- string? keyword = null,
- string? sort = null
- ) => {
- var result = await sender.Send(new Application.Features.Api.Channel.GetLiveList.Query(limit, offset, keyword, sort), ct);
- return result.Match(
- () => ApiResponse.Ok(result.Value),
- CustomResults.Problem
- );
- })
- .WithTags("Channel")
- .AllowAnonymous()
- .RequireFeature(c => c.Channel);
- }
- }
|