fix: correct BlogService GetPublishedPagedAsync parameter order
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m25s

Use named parameters for clarity:
- categoryId: null
- ct: ct (cancellation token)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 04:48:52 +09:00
parent 8591d93b88
commit a554e1795a
3 changed files with 61 additions and 63 deletions
@@ -0,0 +1,61 @@
using FastEndpoints;
using TaxBaik.Application.Services;
namespace TaxBaik.Web.Endpoints;
/// <summary>
/// GET /api/sitemap.xml - 동적 사이트맵 생성
/// 블로그 포스트, FAQ, 공지사항 포함
/// </summary>
public class SitemapEndpoint : EndpointWithoutRequest<string>
{
private readonly BlogService _blogService;
public SitemapEndpoint(BlogService blogService)
{
_blogService = blogService;
}
public override void Configure()
{
Get("/sitemap.xml");
AllowAnonymous();
}
public override async Task<string> ExecuteAsync(CancellationToken ct)
{
var baseUrl = "https://www.taxbaik.com/taxbaik";
var urls = new List<string>
{
// 정적 페이지
$"{baseUrl}",
$"{baseUrl}/about",
$"{baseUrl}/services",
$"{baseUrl}/contact",
$"{baseUrl}/privacy",
$"{baseUrl}/terms",
$"{baseUrl}/blog",
$"{baseUrl}/faq",
$"{baseUrl}/announcement",
$"{baseUrl}/inquiry"
};
// 동적 블로그 포스트
var (posts, _) = await _blogService.GetPublishedPagedAsync(1, 1000, categoryId: null, ct: ct);
foreach (var post in posts)
{
urls.Add($"{baseUrl}/blog/{post.Slug}");
}
// XML 생성
var now = DateTime.UtcNow.ToString("yyyy-MM-dd");
var urlEntries = string.Join("\n", urls.Select(url =>
$" <url>\n <loc>{System.Net.WebUtility.HtmlEncode(url)}</loc>\n <lastmod>{now}</lastmod>\n </url>"));
var xml = $"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n{urlEntries}\n</urlset>";
// XML Content-Type 설정
HttpContext.Response.ContentType = "application/xml; charset=utf-8";
return xml;
}
}