* Extended functionalities
* Added different UIs
This commit is contained in:
@@ -62,12 +62,23 @@ builder.Services.AddDbContext<AppDbContext>(options =>
|
||||
// ---------------------------------------------------------------------------
|
||||
// Application services
|
||||
// ---------------------------------------------------------------------------
|
||||
builder.Services.AddSingleton<IRefreshTokenStore, InMemoryRefreshTokenStore>();
|
||||
builder.Services.AddSingleton<IRefreshTokenStore, DbRefreshTokenStore>();
|
||||
builder.Services.AddHostedService<RefreshTokenCleanupService>();
|
||||
builder.Services.AddSingleton<IPasswordHasher<ApplicationUser>, PasswordHasher<ApplicationUser>>();
|
||||
builder.Services.AddScoped<ITokenService, TokenService>();
|
||||
builder.Services.AddScoped<IAuthService, AuthService>();
|
||||
builder.Services.AddScoped<IRecipeService, RecipeService>();
|
||||
builder.Services.AddScoped<IRecipeManagementService, RecipeManagementService>();
|
||||
builder.Services.AddScoped<IRecipeExcelService, RecipeExcelService>();
|
||||
builder.Services.AddScoped<IDietTrackingService, DietTrackingService>();
|
||||
builder.Services.AddScoped<IIngredientCatalogService, IngredientCatalogService>();
|
||||
builder.Services.AddScoped<IMealPlanService, MealPlanService>();
|
||||
builder.Services.Configure<MealPlan.Api.Services.AI.OpenAiOptions>(
|
||||
builder.Configuration.GetSection(MealPlan.Api.Services.AI.OpenAiOptions.SectionName));
|
||||
builder.Services.AddHttpClient<MealPlan.Api.Services.AI.IOpenAiChatService, MealPlan.Api.Services.AI.OpenAiChatService>();
|
||||
builder.Services.AddScoped<MealPlan.Api.Services.Generators.ICatalogMatchingService, MealPlan.Api.Services.Generators.CatalogMatchingService>();
|
||||
builder.Services.AddScoped<MealPlan.Api.Services.Generators.IDietGeneratorService, MealPlan.Api.Services.Generators.DietGeneratorService>();
|
||||
builder.Services.AddScoped<MealPlan.Api.Services.Generators.IRecipeGeneratorService, MealPlan.Api.Services.Generators.RecipeGeneratorService>();
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Authentication / authorization (JWT bearer)
|
||||
@@ -163,6 +174,19 @@ builder.WebHost.ConfigureKestrel(options => options.AddServerHeader = false);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
if (args.Contains("--fix-sequences", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
await using var scope = app.Services.CreateAsyncScope();
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
var messages = await SequenceMaintenance.ResyncIdentitySequencesAsync(db);
|
||||
foreach (var message in messages)
|
||||
{
|
||||
Console.WriteLine(message);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// HTTP request pipeline
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user