using Application.Abstractions.Messaging; using Web.Api.Common; using Web.Api.Extensions; namespace Web.Api.Endpoints.Stocks; /// 종목 상세 — 마스터 + 최근 시세 (익명 열람) internal sealed class Detail : IEndpoint { public void MapEndpoint(IEndpointRouteBuilder app) { app.MapGet("api/stocks/{code:regex(^\\d{{6}}$)}", async ( string code, ISender sender, CancellationToken ct ) => { var result = await sender.Send(new Application.Features.Api.Stocks.GetDetail.Query(code), ct); return result.Match( () => ApiResponse.Ok(result.Value), CustomResults.Problem ); }) .WithTags("Stocks") .AllowAnonymous(); } }