| 123456789101112131415161718192021222324252627 |
- using Application.Abstractions.Messaging;
- using Web.Api.Common;
- using Web.Api.Extensions;
- namespace Web.Api.Endpoints.Stocks;
- /// <summary>종목 상세 — 마스터 + 최근 시세 (익명 열람)</summary>
- 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();
- }
- }
|