## 后端变更 - 添加 @nestjs/websockets, @nestjs/platform-socket.io, socket.io 依赖 - 新增 PriceGateway (price.gateway.ts): WebSocket 网关,namespace /price - 新增 PriceBroadcastScheduler: 每秒广播价格更新到所有连接的客户端 - 更新 ApiModule 和 ApplicationModule 注册新模块 ## Kong API Gateway - 添加 WebSocket 路由: /ws/price -> trading-service:3022/price - 支持 ws/wss 协议 ## 前端变更 - 添加 socket_io_client 依赖 - 新增 PriceWebSocketService: 带自动断线重连机制的 WebSocket 服务 - 指数退避重连策略 (1s -> 30s) - 最大重连次数 10 次 - 连接状态流监听 - 资产页面集成 WebSocket: - initState 时连接,dispose 时断开 - 实时更新价格和销毁倍数 - 保持原有的每秒积分股增长计算 ## 调试日志 - 前后端都添加了详细的调试日志方便排查问题 - 日志前缀: [PriceWS], [AssetPage], [PriceGateway], [PriceBroadcastScheduler] Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| android | ||
| assets | ||
| ios | ||
| lib | ||
| test | ||
| .gitignore | ||
| .metadata | ||
| DEVELOPMENT_GUIDE.md | ||
| README.md | ||
| analysis_options.yaml | ||
| pubspec.yaml | ||
README.md
mining_app
A new Flutter project.
Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.