| 1234567891011121314151617181920212223242526 |
- using Web.Api.Common;
- using Web.Api.Extensions;
- using Application.Abstractions.Messaging;
- namespace Web.Api.Endpoints.Channel;
- /// <summary>채널 상세</summary>
- internal sealed class Get : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- /// 채널 상세 정보 조회 (프로필, 구독자 수, 라이브 상태)
- /// identifier: @handle 또는 YouTube Channel ID (SID)
- app.MapGet("api/channel/{identifier}", async (string identifier, ISender sender, CancellationToken ct) =>
- {
- var result = await sender.Send(new Application.Features.Api.Channel.Get.Query(identifier), ct);
- return result.Match(
- () => ApiResponse.Ok(result.Value),
- CustomResults.Problem
- );
- })
- .WithTags("Channel")
- .RequireFeature(c => c.Channel);
- }
- }
|