37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.SemanticKernel;
|
|
using Volo.Abp.Caching;
|
|
using Volo.Abp.Domain;
|
|
using Yi.Framework.Mapster;
|
|
using Yi.Framework.SemanticKernel;
|
|
using Yi.Framework.Stock.Domain.Managers;
|
|
using Yi.Framework.Stock.Domain.Managers.SemanticKernel.Plugins;
|
|
using Yi.Framework.Stock.Domain.Shared;
|
|
|
|
namespace Yi.Framework.Stock.Domain
|
|
{
|
|
[DependsOn(
|
|
typeof(YiFrameworkStockDomainSharedModule),
|
|
typeof(YiFrameworkMapsterModule),
|
|
typeof(AbpDddDomainModule),
|
|
typeof(YiFrameworkSemanticKernelModule),
|
|
typeof(AbpCachingModule)
|
|
)]
|
|
public class YiFrameworkStockDomainModule : AbpModule
|
|
{
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
var configuration = context.Services.GetConfiguration();
|
|
var services = context.Services;
|
|
|
|
// 添加插件
|
|
services.AddSingleton<KernelPlugin>(sp =>
|
|
KernelPluginFactory.CreateFromType<NewsPlugins>(serviceProvider: sp));
|
|
services.AddSingleton<KernelPlugin>(sp =>
|
|
KernelPluginFactory.CreateFromType<StockPlugins>(serviceProvider: sp));
|
|
|
|
// 注册NewsManager
|
|
services.AddTransient<NewsManager>();
|
|
}
|
|
}
|
|
} |