feat(tpos): add BFF data endpoints with Npgsql + Dapper

- Add Npgsql 9.0.3 and Dapper 2.1.66 packages to Server project
- Create BffDataController with read-only endpoints:
  GET /api/bff/shops
  GET /api/bff/shops/{shopId}/products
  GET /api/bff/shops/{shopId}/categories
  GET /api/bff/shops/{shopId}/tables
  GET /api/bff/shops/{shopId}/appointments
  GET /api/bff/shops/{shopId}/resources
- Register MVC controllers in Program.cs (AddControllers + MapControllers)

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-02-26 20:15:08 +00:00
parent d586563c60
commit 26e13fc38f
3 changed files with 117 additions and 0 deletions

View File

@@ -41,6 +41,10 @@ builder.Services.AddCors(options =>
// VI: Thêm health checks
builder.Services.AddHealthChecks();
// EN: Add MVC controllers for BFF data endpoints
// VI: Thêm MVC controllers cho BFF data endpoints
builder.Services.AddControllers();
var app = builder.Build();
// ═══════════════════════════════════════════════════════════════════════════════
@@ -116,6 +120,10 @@ app.Map("{culture:regex(^(en-US|vi-VN)$)}/{**slug}", async (string culture, Http
return Results.Content(modifiedHtml, "text/html");
});
// EN: Map BFF API controllers
// VI: Map BFF API controllers
app.MapControllers();
// EN: Fallback to index.html for SPA routing (default culture)
// VI: Fallback đến index.html cho SPA routing (ngôn ngữ mặc định)
app.MapFallbackToFile("index.html");