fix(setting): 修复设置应用器注册方法的泛型约束

- 将RegisterApplicator方法的泛型约束从ISettingsData改为IResetApplyAbleSettings
- 更新接口定义中的泛型参数约束
- 修正相关XML文档注释中的接口名称描述
- [release ci]
This commit is contained in:
GeWuYou 2026-01-30 21:34:04 +08:00
parent 7d581f07ca
commit 6172ce96f1
2 changed files with 4 additions and 3 deletions

View File

@ -35,10 +35,11 @@ public interface ISettingsModel : IModel
/// <summary>
/// 注册设置应用器
/// </summary>
/// <typeparam name="T">设置数据类型必须实现ISettingsData接口且具有无参构造函数</typeparam>
/// <typeparam name="T">设置数据类型必须实现IResetApplyAbleSettings接口且具有无参构造函数</typeparam>
/// <param name="applicator">要注册的设置应用器</param>
/// <returns>当前设置模型实例,支持链式调用</returns>
ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator) where T : class, ISettingsData, new();
ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator)
where T : class, IResetApplyAbleSettings, new();
/// <summary>

View File

@ -63,7 +63,7 @@ public class SettingsModel<TRepository> : AbstractModel, ISettingsModel
/// 注册设置应用器
/// </summary>
public ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator)
where T : class, ISettingsData, new()
where T : class, IResetApplyAbleSettings, new()
{
_applicators[typeof(T)] = applicator;
return this;