refactor(setting): 移除设置应用器注册方法中的new()约束

- 从RegisterApplicator方法的泛型约束中移除new()要求
- 修改实现类SettingsModel中的方法签名以匹配接口变更
- 更新抽象层ISettingsModel中的方法约束定义
- 保持原有功能完整性的同时提高代码灵活性
- [release ci]
This commit is contained in:
GeWuYou 2026-01-30 21:48:44 +08:00
parent 6172ce96f1
commit 209c331d1f
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ public interface ISettingsModel : IModel
/// <param name="applicator">要注册的设置应用器</param>
/// <returns>当前设置模型实例,支持链式调用</returns>
ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator)
where T : class, IResetApplyAbleSettings, new();
where T : class, IResetApplyAbleSettings;
/// <summary>

View File

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