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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user