GFramework/GFramework.Core/architecture/DefaultArchitectureConfiguration.cs
GwWuYou 3e672cf56f refactor(architecture): 重构架构基类以支持依赖注入和服务配置
- 将Architecture类重构为使用构造函数注入IArchitectureConfiguration、IArchitectureServices和IArchitectureContext
- 移除泛型参数和单例模式,改为使用依赖注入容器管理实例
- 添加异步初始化方法InitializeAsync支持异步初始化场景
- 引入ArchitectureOptions类统一管理架构配置选项
- 创建DefaultArchitectureConfiguration和DefaultArchitectureServices默认实现
- 新增IArchitectureContext接口提供统一的上下文访问
- 添加IAsyncInitializable接口支持异步初始化能力
- 简化架构生命周期阶段,移除Created、BeforeInit和AfterInit阶段
- 更新事件系统为ITypeEventSystem接口实现
- 重构命令和控制器接口,统一使用IContextAware替代多个能力接口
- 移除FunctionalArchitectureOptions和相关委托配置方式
- 优化日志记录使用配置中的LoggerFactory实例
2025-12-24 23:09:17 +08:00

29 lines
887 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using GFramework.Core.logging;
namespace GFramework.Core.architecture;
/// <summary>
/// 默认架构配置类实现IArchitectureConfiguration接口
/// 提供日志工厂、日志级别和架构选项的默认配置
/// </summary>
public class DefaultArchitectureConfiguration: IArchitectureConfiguration
{
/// <summary>
/// 获取或设置日志工厂实例
/// 默认使用控制台日志工厂
/// </summary>
public ILoggerFactory LoggerFactory { get; set; } = new ConsoleLoggerFactory();
/// <summary>
/// 获取或设置日志级别
/// 默认设置为Info级别
/// </summary>
public LogLevel LogLevel { get; set; } = LogLevel.Info;
/// <summary>
/// 获取或设置架构选项
/// 默认创建新的ArchitectureOptions实例
/// </summary>
public ArchitectureOptions Options { get; set; } = new();
}