Use a shared YavscMessageSender

This commit is contained in:
Paul Schneider 2026-09-12 13:57:25 +01:00
commit 3836faf872
Signed by: notazof
GPG key ID: 1DD5D838E5343B06
4 changed files with 141 additions and 17 deletions

View file

@ -1,18 +1,6 @@
/*
Copyright (c) 2024 HigginsSoft, Alexander Higgins - https://github.com/alexhiggins732/
Copyright (c) 2018, Brock Allen & Dominick Baier. All rights reserved.
Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
Source code and license this software can be found
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/
using Anthropic.SDK;
using IdentityModel;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Yavsc.Abstract.Interfaces;
@ -91,7 +79,8 @@ internal class Program
.TryAddSingleton<ISmtpClientFactory, SmtpClientFactory>();
services
.AddTransient<IBillingService, BillingService>()
.AddTransient<ICalendarManager, CalendarManager>();
.AddTransient<ICalendarManager, CalendarManager>()
.AddTransient<IYavscMessageSender, YavscMessageSender>();
services.AddTransient<IFileSystemAuthManager, FileSystemAuthManager>();
builder.Services.AddSession(options =>
{
@ -123,9 +112,7 @@ internal class Program
;
app.MapIdentityApi<ApplicationUser>().RequireAuthorization("ApiScope");
app.MapDefaultControllerRoute();
app.MapGet("/identity", (HttpContext context) =>
new JsonResult(context?.User?.Claims.Select(c => new { c.Type, c.Value }))
);
app.UseSession();
await app.RunAsync();