2025-03-08 22:14:26 +08:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.SemanticKernel;
|
2025-03-01 00:06:56 +08:00
|
|
|
using Volo.Abp.Caching;
|
|
|
|
|
using Volo.Abp.Domain;
|
|
|
|
|
using Yi.Framework.Mapster;
|
2025-06-17 23:25:55 +08:00
|
|
|
using Yi.Framework.SemanticKernel;
|
2025-03-07 00:35:32 +08:00
|
|
|
using Yi.Framework.Stock.Domain.Managers;
|
2025-03-08 22:14:26 +08:00
|
|
|
using Yi.Framework.Stock.Domain.Managers.SemanticKernel.Plugins;
|
|
|
|
|
using Yi.Framework.Stock.Domain.Shared;
|
2025-03-01 00:06:56 +08:00
|
|
|
|
|
|
|
|
namespace Yi.Framework.Stock.Domain
|
|
|
|
|
{
|
|
|
|
|
[DependsOn(
|
|
|
|
|
typeof(YiFrameworkStockDomainSharedModule),
|
|
|
|
|
typeof(YiFrameworkMapsterModule),
|
|
|
|
|
typeof(AbpDddDomainModule),
|
2025-06-17 23:25:55 +08:00
|
|
|
typeof(YiFrameworkSemanticKernelModule),
|
2025-03-01 00:06:56 +08:00
|
|
|
typeof(AbpCachingModule)
|
|
|
|
|
)]
|
|
|
|
|
public class YiFrameworkStockDomainModule : AbpModule
|
|
|
|
|
{
|
2025-03-07 00:35:32 +08:00
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
|
|
|
{
|
2025-03-08 22:14:26 +08:00
|
|
|
var configuration = context.Services.GetConfiguration();
|
|
|
|
|
var services = context.Services;
|
2025-06-17 23:25:55 +08:00
|
|
|
|
2025-03-08 22:14:26 +08:00
|
|
|
// 添加插件
|
2025-06-17 23:25:55 +08:00
|
|
|
services.AddSingleton<KernelPlugin>(sp =>
|
|
|
|
|
KernelPluginFactory.CreateFromType<NewsPlugins>(serviceProvider: sp));
|
|
|
|
|
services.AddSingleton<KernelPlugin>(sp =>
|
|
|
|
|
KernelPluginFactory.CreateFromType<StockPlugins>(serviceProvider: sp));
|
|
|
|
|
|
2025-03-08 22:14:26 +08:00
|
|
|
// 注册NewsManager
|
|
|
|
|
services.AddTransient<NewsManager>();
|
2025-03-07 00:35:32 +08:00
|
|
|
}
|
2025-03-01 00:06:56 +08:00
|
|
|
}
|
|
|
|
|
}
|