mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
feat(core): 集成 Mediator 框架并配置服务
- 添加 Mediator 框架依赖注入配置 - 设置 Mediator 命名空间为 GFramework.Core.Mediator - 配置 Mediator 服务生命周期为单例模式 - 设置生成类型为内部访问权限 - 配置通知发布器类型为 ForeachAwaitPublisher - 添加必要的 using 语句引入 Mediator 和常量模块
This commit is contained in:
parent
ec07f6b2ef
commit
b7efe0cac4
@ -10,6 +10,7 @@ using GFramework.Core.Abstractions.utility;
|
||||
using GFramework.Core.environment;
|
||||
using GFramework.Core.extensions;
|
||||
using GFramework.Core.logging;
|
||||
using Mediator;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using IDisposable = GFramework.Core.Abstractions.lifecycle.IDisposable;
|
||||
|
||||
@ -625,9 +626,14 @@ public abstract class Architecture(
|
||||
|
||||
// 为服务设置上下文
|
||||
Services.SetContext(_context);
|
||||
|
||||
// 添加 Mediator
|
||||
Container.Services.AddMediator();
|
||||
Container.Services.AddMediator(options =>
|
||||
{
|
||||
options.Namespace = "GFramework.Core.Mediator";
|
||||
options.ServiceLifetime = ServiceLifetime.Singleton;
|
||||
options.GenerateTypesAsInternal = true;
|
||||
options.NotificationPublisherType = typeof(ForeachAwaitPublisher);
|
||||
});
|
||||
|
||||
// === 用户 Init ===
|
||||
_logger.Debug("Calling user Init()");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user