Major architecture optimization and various bug fixes - #27
Merged
Merged
Conversation
…Culture与参数钳制、投资选择链路不再吞取消
…nal护栏去重、限流/哈希/词边界/越界校验、线程与生命周期修复、符号转换收敛
…ktoken、SourceType 统一推断、AnalysisReportCache 换 IMemoryCache、杂项健壮性修复
…止竞态、取整零数量拒单、Reset走草稿、涨跌幅Culture对齐、Dispose后台收尾
本次提交为大规模架构优化,主要内容包括: - 统一 ViewModel/服务层依赖注入为具名工厂接口,消除 IServiceProvider 和裸 Func 反模式,提升类型安全与可维护性。 - 大量 ViewModel 构造与服务注册切换为工厂接口,页面 ViewModel 以 Transient 注册,导航时实例化,避免主窗口构造时实例化全部页面。 - 首页、收藏、选股、告警、设置等页面及子 ViewModel 通过 IMarketServiceRegistry 按市场类型解析服务,移除对 IServiceProvider 的直接依赖。 - RAG、MarketMonitor、投资选择等依赖通过专用 Provider/Factory 延迟解析,打破循环依赖,提升并发与资源管理能力。 - 新增 ImageCaptionClientFactory,统一多模态 Caption 客户端创建与降级。 - BinanceWebSocketService 连接生命周期管理优化,所有操作串行化,防止并发重连导致资源泄漏,支持断线重试。 - 修复 NewsUpdateService、BinanceUserDataStreamService 等 Stop/Start/重连场景下的资源释放与并发安全问题。 - 通知服务支持多通知堆叠与自动下移,优化用户体验。 - 首页最近查看条支持滚轮横向滚动。 - KLineChartView 离开可视树时释放 WebView 资源,避免句柄泄漏。 - 价格预警服务初始化异常时显式通知用户。 - 清理所有无意义注释,仅保留函数级文档和晦涩逻辑说明,代码更简洁。 - 统一数据解析区域性问题,使用 InvariantCulture 解析小数。 - 优化 CoinGecko/CoinDesk 币种 ID 解析逻辑,减少不必要的 HTTP 请求。 - 异步方法补充 CancellationToken,数据库连接异步化并优化并发锁处理。 - 优化正则表达式,提升文本清洗准确性。 - 增强单元测试隔离性,调整依赖注入注册方式,提升测试健壮性。 - 其它细节:异常处理、资源释放、UI 线程切换、集合线程安全、日志目录创建等优化。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Major architecture optimization and various bug fixes