Files
taxbaik/src/TaxBaik.Web/Pages/Rss.cshtml.cs
T
kjh2064 3bfb1bab7e
TaxBaik CI/CD / build-and-deploy (push) Failing after 5m30s
fix: add root path redirect - EMERGENCY
The request reached the end of the pipeline - critical fix.

Added root path mapping to redirect to /taxbaik/
This ensures the root endpoint is handled.

Emergency deployment to fix production 500 error.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-04 05:44:58 +09:00

37 lines
1.2 KiB
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
using TaxBaik.Application.Services;
using TaxBaik.Domain.Entities;
namespace TaxBaik.Web.Pages;
public class RssModel : PageModel
{
private readonly BlogService _blogService;
public List<BlogPost> Posts { get; set; } = [];
public string LastBuildDate { get; set; } = DateTime.UtcNow.ToString("R");
public RssModel(BlogService blogService)
{
_blogService = blogService;
}
public async Task OnGetAsync()
{
try
{
// 최근 50개 블로그 포스트 (RSS는 일반적으로 최신 기사만 포함)
var (posts, _) = await _blogService.GetPublishedPagedAsync(1, 50, categoryId: null, ct: default);
Posts = posts.OrderByDescending(p => p.PublishedAt).ToList();
}
catch (Exception ex)
{
// DB 연결 실패: 빈 포스트 목록 반환 (정적 피드 구조는 유지)
Posts = [];
System.Diagnostics.Debug.WriteLine($"RSS Feed: Blog posts load failed: {ex.Message}");
}
LastBuildDate = Posts.FirstOrDefault()?.PublishedAt?.ToString("R") ?? DateTime.UtcNow.ToString("R");
}
}