feat: 重构仓位轮训逻辑并修复多语言配置

主要改动:
1. 创建独立的 PositionCheckService 服务
   - 将仓位检查逻辑从 PositionPushService 中分离
   - 实现待赎回仓位检查和未卖出订单检查
   - 实现订单状态更新逻辑(FIFO策略)

2. 修改 PositionPushService
   - 后端启动时自动启动轮训任务
   - 每次轮训后推送全量数据给所有订阅的客户端
   - 调用 PositionCheckService 进行仓位检查

3. 自动赎回功能调整
   - 将自动赎回从跟单配置级别移到系统级别
   - 添加系统级自动赎回配置管理
   - 支持 Builder API Key 配置检查

4. 多语言配置修复
   - 修复 PositionCheckService 中的硬编码消息
   - 使用 MessageSource 获取多语言文本
   - 添加自动赎回和 Builder API Key 相关的多语言资源

5. 数据库迁移
   - V8: 添加跟单配置名称字段
   - V9: 将自动赎回配置移到系统配置表

6. 前端更新
   - 添加系统级自动赎回配置界面
   - 更新跟单配置管理界面
   - 添加 Builder API Key 配置界面
This commit is contained in:
WrBug
2025-12-07 02:06:19 +08:00
parent bfbbbdd1de
commit cb167d442f
31 changed files with 1544 additions and 121 deletions
@@ -16,6 +16,32 @@ notification.order.time=Time
notification.order.error_info=Error Information
notification.order.unknown_account=Unknown Account
notification.order.calculate_failed=Calculation Failed
notification.redeem.success=Position Redeemed Successfully
notification.redeem.info=Redeem Information
notification.redeem.transaction_hash=Transaction Hash
notification.redeem.total_value=Total Redeemed Value
notification.redeem.position_count=Position Count
notification.redeem.positions=Redeemed Positions
notification.redeem.account=Account
notification.redeem.time=Time
# Auto Redeem related notifications
notification.auto_redeem.disabled.title=Auto Redeem Disabled
notification.auto_redeem.disabled.account=Account
notification.auto_redeem.disabled.redeemable_positions=Redeemable Positions
notification.auto_redeem.disabled.total_value=Total Value
notification.auto_redeem.disabled.message=Please enable auto redeem in system settings.
notification.auto_redeem.disabled.positions_unit=
# Builder API Key related notifications
notification.builder_api_key.not_configured.title=Builder API Key Not Configured
notification.builder_api_key.not_configured.account=Account
notification.builder_api_key.not_configured.copy_trading_config=Copy Trading Config
notification.builder_api_key.not_configured.redeemable_positions=Redeemable Positions
notification.builder_api_key.not_configured.total_value=Total Value
notification.builder_api_key.not_configured.message=Please configure Builder API Key in system settings to enable auto redeem.
notification.builder_api_key.not_configured.positions_unit=
notification.builder_api_key.not_configured.unknown_config=Unnamed Config
# Common
common.unknown=Unknown
@@ -16,6 +16,32 @@ notification.order.time=时间
notification.order.error_info=错误信息
notification.order.unknown_account=未知账户
notification.order.calculate_failed=计算失败
notification.redeem.success=仓位赎回成功
notification.redeem.info=赎回信息
notification.redeem.transaction_hash=交易哈希
notification.redeem.total_value=赎回总价值
notification.redeem.position_count=仓位数量
notification.redeem.positions=赎回仓位
notification.redeem.account=账户
notification.redeem.time=时间
# 自动赎回相关通知
notification.auto_redeem.disabled.title=自动赎回未开启
notification.auto_redeem.disabled.account=账户
notification.auto_redeem.disabled.redeemable_positions=可赎回仓位
notification.auto_redeem.disabled.total_value=总价值
notification.auto_redeem.disabled.message=请在系统设置中开启自动赎回功能。
notification.auto_redeem.disabled.positions_unit=
# Builder API Key 相关通知
notification.builder_api_key.not_configured.title=Builder API Key 未配置
notification.builder_api_key.not_configured.account=账户
notification.builder_api_key.not_configured.copy_trading_config=跟单配置
notification.builder_api_key.not_configured.redeemable_positions=可赎回仓位
notification.builder_api_key.not_configured.total_value=总价值
notification.builder_api_key.not_configured.message=请在系统设置中配置 Builder API Key 以启用自动赎回功能。
notification.builder_api_key.not_configured.positions_unit=
notification.builder_api_key.not_configured.unknown_config=未命名配置
# 通用
common.unknown=未知
@@ -16,6 +16,32 @@ notification.order.time=時間
notification.order.error_info=錯誤信息
notification.order.unknown_account=未知賬戶
notification.order.calculate_failed=計算失敗
notification.redeem.success=倉位贖回成功
notification.redeem.info=贖回信息
notification.redeem.transaction_hash=交易哈希
notification.redeem.total_value=贖回總價值
notification.redeem.position_count=倉位數量
notification.redeem.positions=贖回倉位
notification.redeem.account=賬戶
notification.redeem.time=時間
# 自動贖回相關通知
notification.auto_redeem.disabled.title=自動贖回未開啟
notification.auto_redeem.disabled.account=賬戶
notification.auto_redeem.disabled.redeemable_positions=可贖回倉位
notification.auto_redeem.disabled.total_value=總價值
notification.auto_redeem.disabled.message=請在系統設置中開啟自動贖回功能。
notification.auto_redeem.disabled.positions_unit=
# Builder API Key 相關通知
notification.builder_api_key.not_configured.title=Builder API Key 未配置
notification.builder_api_key.not_configured.account=賬戶
notification.builder_api_key.not_configured.copy_trading_config=跟單配置
notification.builder_api_key.not_configured.redeemable_positions=可贖回倉位
notification.builder_api_key.not_configured.total_value=總價值
notification.builder_api_key.not_configured.message=請在系統設置中配置 Builder API Key 以啟用自動贖回功能。
notification.builder_api_key.not_configured.positions_unit=
notification.builder_api_key.not_configured.unknown_config=未命名配置
# 通用
common.unknown=未知