mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 03:04:29 +08:00
- 将架构相关接口从 GFramework.Core 迁移至 GFramework.Core.Abstractions 项目 - 更新项目引用配置,添加对抽象层项目的项目引用 - 修正命名空间引用,使用新的抽象层命名空间 - 调整类型定义,将 List<T> 替换为更通用的 IList<T> 接口 - 修复控制器接口命名空间错误 - 添加必要的 using 语句以支持新的抽象层引用
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using GFramework.Core.Abstractions.logging;
|
|
using GFramework.Core.Abstractions.utility;
|
|
using GFramework.Core.rule;
|
|
|
|
namespace GFramework.Core.utility;
|
|
|
|
/// <summary>
|
|
/// 抽象上下文工具类,提供上下文相关的通用功能实现
|
|
/// 继承自ContextAwareBase并实现IContextUtility接口
|
|
/// </summary>
|
|
public abstract class AbstractContextUtility : ContextAwareBase, IContextUtility
|
|
{
|
|
protected ILogger Logger = null !;
|
|
|
|
/// <summary>
|
|
/// 初始化上下文工具类
|
|
/// </summary>
|
|
void IContextUtility.Init()
|
|
{
|
|
// 获取上下文中的日志记录器
|
|
Logger = Context.LoggerFactory.GetLogger(nameof(AbstractContextUtility));
|
|
Logger.Debug($"Initializing Context Utility: {GetType().Name}");
|
|
|
|
// 执行子类实现的初始化逻辑
|
|
OnInit();
|
|
|
|
// 记录初始化完成信息
|
|
Logger.Info($"Context Utility initialized: {GetType().Name}");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 抽象初始化方法,由子类实现具体的初始化逻辑
|
|
/// </summary>
|
|
protected abstract void OnInit();
|
|
} |