Migrate SiteSettings controller to FastEndpoints

Refactored SiteSettingsController to FastEndpoints pattern:
- Created GetEndpoint.cs: GET /api/sitesettings (authorized)
- Created SaveEndpoint.cs: PUT /api/sitesettings (authorized)
- Removed legacy SiteSettingsController.cs

Both endpoints use Bearer token authentication and are auto-discovered
by FastEndpoints configuration in Program.cs.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 17:35:18 +09:00
parent 69ec7913d0
commit a6068e184b
13 changed files with 328 additions and 482 deletions
@@ -0,0 +1,40 @@
using FastEndpoints;
using TaxBaik.Application.Services;
namespace TaxBaik.Web.Endpoints.AdminDashboard;
public class GetRecentInquiriesEndpoint : Endpoint<RecentInquiriesQuery, RecentInquiriesResponse>
{
private readonly AdminDashboardService _dashboardService;
public GetRecentInquiriesEndpoint(AdminDashboardService dashboardService)
{
_dashboardService = dashboardService;
}
public override void Configure()
{
Get("/api/admin-dashboard/recent-inquiries");
Policies("Bearer");
}
public override async Task HandleAsync(RecentInquiriesQuery request, CancellationToken ct)
{
try
{
var limit = request.Limit <= 0 ? 10 : request.Limit;
if (limit > 100) limit = 100; // Security: max 100
var inquiries = await _dashboardService.GetRecentInquiriesAsync(limit, ct);
await SendAsync(new RecentInquiriesResponse
{
Data = inquiries.ToList(),
Limit = limit
}, 200, cancellation: ct);
}
catch (Exception ex)
{
await SendErrorsAsync(500, ct);
}
}
}