## 后端变更 - 添加 @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> |
||
|---|---|---|
| .. | ||
| .claude | ||
| api-gateway | ||
| infrastructure | ||
| mpc-system | ||
| scripts | ||
| services | ||
| .env.windows | ||
| docker-compose.windows.yml | ||