fix(interest): SwapDealIndexFixer 改用委托, 修复 CS0122 编译错误

问题: SwapDealIndexFixer(internal)访问 SwapDealService.TryGetFloatRate
(protected) 报 CS0122, 因非嵌套类无权访问 protected 成员。

修复: SwapDealIndexFixer 改为接受 Func<DateTime,string,(bool,double)> 委托,
SwapDealService.IndexFixer 属性传入 TryGetFloatRate 的包装。
- 无需访问 protected 成员
- SwapDealIndexFixer 保持独立文件(clean code)
- virtual 接缝仍保留(测试 override TryGetFloatRate 仍生效)

验证: YLErpDAL.csproj 编译 0 错误, 全量480测试7失败(基线一致,零回归),
CI_007/CI_008 通过。
This commit is contained in:
hjhan
2026-08-11 09:23:01 +08:00
parent 59c16aabc1
commit 30ae93b8ca
2 changed files with 14 additions and 9 deletions
@@ -26,7 +26,9 @@ namespace YLErp.Modules.SwapModule
private IIndexFixer _indexFixer;
/// <summary>FR007 取价器,委托 TryGetFloatRate(保留 virtual 接缝供测试 stub)。</summary>
protected virtual IIndexFixer IndexFixer => _indexFixer ??= new SwapDealIndexFixer(this);
protected virtual IIndexFixer IndexFixer
=> _indexFixer ??= new SwapDealIndexFixer((d, c) =>
TryGetFloatRate(d, c, out double r) ? (true, r) : (false, 0d));
#region Seamsoverride DB/