feat: 完善 Telegram 推送通知功能
- 推送模板优化: - 优先使用账户名称而不是钱包地址 - 使用市场标题而不是16进制ID - 添加可点击的市场链接(支持 slug 和 conditionId) - 添加市场方向(outcome)显示 - 数量和价格从订单详情API获取实际值 - 失败通知只显示后端返回的msg,不显示完整堆栈 - 多语言支持: - 后端推送消息支持多语言(使用前端最后请求的语言) - 添加所有 ErrorCode 的多语言资源文件(中文简体、繁体、英文) - 通知消息文本全部使用多语言资源 - 功能改进: - 从订单详情获取实际的 side、price、size、outcome - 支持买入/卖出方向的多语言显示 - 错误信息优化,只显示后端返回的错误消息
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
-- ============================================
|
||||
-- 创建消息推送配置表
|
||||
-- 支持多种推送方式(Telegram、Discord、Slack 等)
|
||||
-- ============================================
|
||||
|
||||
CREATE TABLE IF NOT EXISTS notification_configs (
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
type VARCHAR(50) NOT NULL COMMENT '推送类型(telegram、discord、slack 等)',
|
||||
name VARCHAR(100) NOT NULL COMMENT '配置名称(用于显示)',
|
||||
enabled BOOLEAN NOT NULL DEFAULT TRUE COMMENT '是否启用',
|
||||
config_json TEXT NOT NULL COMMENT '配置信息(JSON格式,不同类型存储不同字段)',
|
||||
created_at BIGINT NOT NULL COMMENT '创建时间(毫秒时间戳)',
|
||||
updated_at BIGINT NOT NULL COMMENT '更新时间(毫秒时间戳)',
|
||||
INDEX idx_type (type),
|
||||
INDEX idx_enabled (enabled),
|
||||
INDEX idx_type_enabled (type, enabled)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息推送配置表';
|
||||
|
||||
-- ============================================
|
||||
-- 配置说明
|
||||
-- ============================================
|
||||
-- config_json 字段存储 JSON 格式的配置信息
|
||||
--
|
||||
-- Telegram 配置示例:
|
||||
-- {
|
||||
-- "botToken": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
|
||||
-- "chatIds": ["123456789", "987654321"]
|
||||
-- }
|
||||
--
|
||||
-- Discord 配置示例(未来扩展):
|
||||
-- {
|
||||
-- "webhookUrl": "https://discord.com/api/webhooks/..."
|
||||
-- }
|
||||
--
|
||||
-- Slack 配置示例(未来扩展):
|
||||
-- {
|
||||
-- "webhookUrl": "https://hooks.slack.com/services/..."
|
||||
-- }
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
# Notification related
|
||||
notification.order.created.success=Order Created Successfully
|
||||
notification.order.created.failed=Order Creation Failed
|
||||
notification.order.info=Order Information
|
||||
notification.order.id=Order ID
|
||||
notification.order.market=Market
|
||||
notification.order.side=Side
|
||||
notification.order.side.buy=Buy
|
||||
notification.order.side.sell=Sell
|
||||
notification.order.outcome=Market Outcome
|
||||
notification.order.price=Price
|
||||
notification.order.quantity=Quantity
|
||||
notification.order.amount=Amount
|
||||
notification.order.account=Account
|
||||
notification.order.time=Time
|
||||
notification.order.error_info=Error Information
|
||||
notification.order.unknown_account=Unknown Account
|
||||
notification.order.calculate_failed=Calculation Failed
|
||||
|
||||
# Common
|
||||
common.unknown=Unknown
|
||||
|
||||
# ==================== Parameter Errors (1001-1999) ====================
|
||||
error.param.error=Parameter Error
|
||||
error.param.empty=Parameter cannot be empty
|
||||
error.param.invalid=Parameter is invalid
|
||||
|
||||
# Account related parameter errors
|
||||
error.param.private_key_empty=Private key cannot be empty
|
||||
error.param.wallet_address_empty=Wallet address cannot be empty
|
||||
error.param.wallet_address_invalid=Wallet address format is invalid
|
||||
error.param.account_id_invalid=Account ID is invalid
|
||||
error.param.account_name_empty=Account name cannot be empty
|
||||
|
||||
# Leader related parameter errors
|
||||
error.param.leader_address_empty=Leader address cannot be empty
|
||||
error.param.leader_address_invalid=Leader address format is invalid
|
||||
error.param.leader_id_invalid=Leader ID is invalid
|
||||
error.param.leader_name_empty=Leader name cannot be empty
|
||||
error.param.category_invalid=Category is invalid, only supports sports or crypto
|
||||
|
||||
# Template related parameter errors
|
||||
error.param.template_name_empty=Template name cannot be empty
|
||||
error.param.template_id_invalid=Template ID is invalid
|
||||
error.param.copy_mode_invalid=copyMode must be RATIO or FIXED
|
||||
error.param.copy_ratio_invalid=Copy ratio is invalid
|
||||
error.param.fixed_amount_invalid=Fixed amount is invalid
|
||||
|
||||
# Copy trading related parameter errors
|
||||
error.param.copy_trading_id_invalid=Copy trading ID is invalid
|
||||
error.param.order_type_invalid=Order type is invalid
|
||||
error.param.order_type_must_be_market_or_limit=Order type must be MARKET or LIMIT
|
||||
error.param.quantity_empty=Quantity cannot be empty
|
||||
error.param.price_empty=Limit order must provide price
|
||||
error.param.side_empty=Side cannot be empty
|
||||
error.param.market_id_empty=Market ID cannot be empty
|
||||
error.param.order_type_empty=Order type cannot be empty
|
||||
|
||||
# Market related parameter errors
|
||||
error.param.token_id_empty=tokenId cannot be empty
|
||||
error.param.condition_id_empty=conditionId cannot be empty
|
||||
error.param.redeem_positions_empty=Redeem positions list cannot be empty
|
||||
error.param.index_sets_invalid=Index sets is invalid
|
||||
|
||||
# Statistics related parameter errors
|
||||
error.param.order_type_invalid_for_tracking=Order type is invalid, must be: buy, sell, matched
|
||||
|
||||
# ==================== Authentication/Permission Errors (2001-2999) ====================
|
||||
error.auth.error=Authentication Failed
|
||||
error.auth.token_invalid=Authentication token is invalid
|
||||
error.auth.token_expired=Authentication token has expired
|
||||
error.auth.permission_denied=Permission denied
|
||||
error.auth.api_key_invalid=API Key is invalid
|
||||
error.auth.api_secret_invalid=API Secret is invalid
|
||||
error.auth.api_passphrase_invalid=API Passphrase is invalid
|
||||
error.auth.api_credentials_missing=API credentials not configured
|
||||
error.auth.username_or_password_error=Username or password is incorrect
|
||||
error.auth.reset_key_invalid=Reset key is invalid
|
||||
error.auth.reset_password_rate_limit=Rate limit: Maximum 3 attempts per minute, please try again later
|
||||
error.auth.user_not_found=User not found
|
||||
error.auth.password_weak=Password length does not meet requirements, at least 6 characters
|
||||
|
||||
# ==================== Resource Not Found (3001-3999) ====================
|
||||
error.not_found=Resource not found
|
||||
error.account_not_found=Account not found
|
||||
error.leader_not_found=Leader not found
|
||||
error.template_not_found=Template not found
|
||||
error.copy_trading_not_found=Copy trading not found
|
||||
error.market_not_found=Market not found
|
||||
error.order_not_found=Order not found
|
||||
error.position_not_found=Position not found
|
||||
|
||||
# ==================== Business Logic Errors (4001-4999) ====================
|
||||
error.business.error=Business logic error
|
||||
|
||||
# Leader management
|
||||
error.leader_already_exists=This Leader address already exists
|
||||
error.leader_address_same_as_account=Leader address cannot be the same as your account address
|
||||
error.leader_has_copy_tradings=This Leader still has copy trading relationships, please delete them first
|
||||
|
||||
# Template management
|
||||
error.template_name_already_exists=Template name already exists
|
||||
error.template_has_copy_tradings=This template is still being used by copy trading relationships, please delete them first
|
||||
|
||||
# Copy trading management
|
||||
error.copy_trading_already_exists=This copy trading relationship already exists
|
||||
error.copy_trading_disabled=Copy trading relationship is disabled
|
||||
error.copy_trading_enabled=Copy trading relationship is enabled
|
||||
error.no_enabled_copy_tradings=No enabled copy trading relationships
|
||||
|
||||
# Order related
|
||||
error.order_create_failed=Failed to create order
|
||||
error.order_cancel_failed=Failed to cancel order
|
||||
error.order_not_matched=Order not matched
|
||||
error.order_already_filled=Order already filled
|
||||
error.order_insufficient_balance=Insufficient balance
|
||||
error.order_amount_too_small=Order amount is below minimum limit
|
||||
error.order_amount_too_large=Order amount exceeds maximum limit
|
||||
error.order_price_invalid=Order price is invalid
|
||||
error.order_quantity_invalid=Order quantity is invalid
|
||||
|
||||
# Market related
|
||||
error.market_price_fetch_failed=Failed to fetch market price
|
||||
error.market_orderbook_empty=Orderbook is empty
|
||||
error.market_token_id_invalid=Token ID is invalid
|
||||
|
||||
# Position related
|
||||
error.position_redeem_failed=Failed to redeem position
|
||||
error.position_not_redeemable=Position is not redeemable
|
||||
error.position_insufficient=Insufficient position
|
||||
error.position_already_redeemed=Position already redeemed
|
||||
|
||||
# Notification config related
|
||||
error.notification_config_not_found=Notification config not found
|
||||
error.notification_config_id_empty=Config ID cannot be empty
|
||||
error.notification_config_type_empty=Notification type cannot be empty
|
||||
error.notification_config_name_empty=Config name cannot be empty
|
||||
error.notification_config_data_empty=Config data cannot be empty
|
||||
error.notification_config_bot_token_empty=Bot Token cannot be empty
|
||||
error.notification_config_create_failed=Failed to create config
|
||||
error.notification_config_update_failed=Failed to update config
|
||||
error.notification_config_delete_failed=Failed to delete config
|
||||
error.notification_config_update_enabled_failed=Failed to update enabled status
|
||||
error.notification_config_fetch_failed=Failed to fetch config
|
||||
error.notification_test_failed=Failed to send test message, please check config
|
||||
error.notification_get_chat_ids_failed=Failed to get Chat IDs
|
||||
|
||||
# Account related business errors
|
||||
error.account_already_exists=Account already exists
|
||||
error.account_is_default=Account is already the default account
|
||||
error.account_has_active_orders=Account has active orders
|
||||
error.account_is_last_one=Cannot delete the last account
|
||||
error.account_api_key_create_failed=Failed to automatically get API Key
|
||||
error.account_proxy_address_fetch_failed=Failed to fetch proxy address
|
||||
error.account_balance_fetch_failed=Failed to query account balance
|
||||
error.account_positions_fetch_failed=Failed to query positions list
|
||||
|
||||
# Statistics related
|
||||
error.statistics_fetch_failed=Failed to fetch statistics
|
||||
error.order_list_fetch_failed=Failed to query order list
|
||||
|
||||
# ==================== Server Internal Errors (5001-5999) ====================
|
||||
error.server.error=Server internal error
|
||||
error.server.database_error=Database error
|
||||
error.server.network_error=Network error
|
||||
error.server.timeout=Request timeout
|
||||
error.server.external_api_error=External API call failed
|
||||
error.server.rpc_error=RPC call failed
|
||||
error.server.websocket_error=WebSocket connection error
|
||||
error.server.encryption_error=Encryption/decryption error
|
||||
error.server.signature_error=Signature error
|
||||
|
||||
# Account service errors
|
||||
error.server.account_import_failed=Failed to import account
|
||||
error.server.account_update_failed=Failed to update account
|
||||
error.server.account_delete_failed=Failed to delete account
|
||||
error.server.account_list_fetch_failed=Failed to query account list
|
||||
error.server.account_detail_fetch_failed=Failed to query account detail
|
||||
error.server.account_balance_fetch_failed=Failed to query account balance
|
||||
error.server.account_default_set_failed=Failed to set default account
|
||||
error.server.account_positions_fetch_failed=Failed to query positions list
|
||||
error.server.account_order_create_failed=Failed to create sell order
|
||||
error.server.account_redeem_positions_failed=Failed to redeem positions
|
||||
|
||||
# Leader service errors
|
||||
error.server.leader_add_failed=Failed to add Leader
|
||||
error.server.leader_update_failed=Failed to update Leader
|
||||
error.server.leader_delete_failed=Failed to delete Leader
|
||||
error.server.leader_list_fetch_failed=Failed to query Leader list
|
||||
error.server.leader_detail_fetch_failed=Failed to query Leader detail
|
||||
|
||||
# Template service errors
|
||||
error.server.template_create_failed=Failed to create template
|
||||
error.server.template_update_failed=Failed to update template
|
||||
error.server.template_delete_failed=Failed to delete template
|
||||
error.server.template_copy_failed=Failed to copy template
|
||||
error.server.template_list_fetch_failed=Failed to query template list
|
||||
error.server.template_detail_fetch_failed=Failed to query template detail
|
||||
|
||||
# Copy trading service errors
|
||||
error.server.copy_trading_create_failed=Failed to create copy trading
|
||||
error.server.copy_trading_update_failed=Failed to update copy trading
|
||||
error.server.copy_trading_delete_failed=Failed to delete copy trading
|
||||
error.server.copy_trading_list_fetch_failed=Failed to query copy trading list
|
||||
error.server.copy_trading_templates_fetch_failed=Failed to query templates bound to wallet
|
||||
|
||||
# Market service errors
|
||||
error.server.market_price_fetch_failed=Failed to fetch market price
|
||||
error.server.market_latest_price_fetch_failed=Failed to fetch latest price
|
||||
|
||||
# Statistics service errors
|
||||
error.server.statistics_fetch_failed=Failed to fetch statistics
|
||||
error.server.order_tracking_list_fetch_failed=Failed to query order list
|
||||
|
||||
# Blockchain service errors
|
||||
error.server.blockchain_rpc_error=Blockchain RPC call failed
|
||||
error.server.blockchain_proxy_address_fetch_failed=Failed to fetch proxy address
|
||||
error.server.blockchain_balance_fetch_failed=Failed to query balance
|
||||
error.server.blockchain_positions_fetch_failed=Failed to query positions
|
||||
error.server.blockchain_redeem_failed=Failed to redeem position transaction
|
||||
|
||||
# WebSocket service errors
|
||||
error.server.websocket_connection_failed=WebSocket connection failed
|
||||
error.server.websocket_message_send_failed=WebSocket message send failed
|
||||
error.server.websocket_subscribe_failed=WebSocket subscribe failed
|
||||
|
||||
# Order tracking service errors
|
||||
error.server.order_tracking_process_failed=Failed to process order tracking
|
||||
error.server.order_tracking_buy_failed=Failed to process buy order
|
||||
error.server.order_tracking_sell_failed=Failed to process sell order
|
||||
error.server.order_tracking_match_failed=Order matching failed
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
# 通知相关
|
||||
notification.order.created.success=订单创建成功
|
||||
notification.order.created.failed=订单创建失败
|
||||
notification.order.info=订单信息
|
||||
notification.order.id=订单ID
|
||||
notification.order.market=市场
|
||||
notification.order.side=方向
|
||||
notification.order.side.buy=买入
|
||||
notification.order.side.sell=卖出
|
||||
notification.order.outcome=市场方向
|
||||
notification.order.price=价格
|
||||
notification.order.quantity=数量
|
||||
notification.order.amount=金额
|
||||
notification.order.account=账户
|
||||
notification.order.time=时间
|
||||
notification.order.error_info=错误信息
|
||||
notification.order.unknown_account=未知账户
|
||||
notification.order.calculate_failed=计算失败
|
||||
|
||||
# 通用
|
||||
common.unknown=未知
|
||||
|
||||
# ==================== 参数错误 (1001-1999) ====================
|
||||
error.param.error=参数错误
|
||||
error.param.empty=参数不能为空
|
||||
error.param.invalid=参数无效
|
||||
|
||||
# 账户相关参数错误
|
||||
error.param.private_key_empty=私钥不能为空
|
||||
error.param.wallet_address_empty=钱包地址不能为空
|
||||
error.param.wallet_address_invalid=钱包地址格式无效
|
||||
error.param.account_id_invalid=账户ID无效
|
||||
error.param.account_name_empty=账户名称不能为空
|
||||
|
||||
# Leader 相关参数错误
|
||||
error.param.leader_address_empty=Leader 地址不能为空
|
||||
error.param.leader_address_invalid=Leader 地址格式无效
|
||||
error.param.leader_id_invalid=Leader ID 无效
|
||||
error.param.leader_name_empty=Leader 名称不能为空
|
||||
error.param.category_invalid=分类无效,只支持 sports 或 crypto
|
||||
|
||||
# 模板相关参数错误
|
||||
error.param.template_name_empty=模板名称不能为空
|
||||
error.param.template_id_invalid=模板 ID 无效
|
||||
error.param.copy_mode_invalid=copyMode 必须是 RATIO 或 FIXED
|
||||
error.param.copy_ratio_invalid=跟单比例无效
|
||||
error.param.fixed_amount_invalid=固定金额无效
|
||||
|
||||
# 跟单相关参数错误
|
||||
error.param.copy_trading_id_invalid=跟单关系ID无效
|
||||
error.param.order_type_invalid=订单类型无效
|
||||
error.param.order_type_must_be_market_or_limit=订单类型必须是MARKET或LIMIT
|
||||
error.param.quantity_empty=数量不能为空
|
||||
error.param.price_empty=限价订单必须提供价格
|
||||
error.param.side_empty=方向不能为空
|
||||
error.param.market_id_empty=市场ID不能为空
|
||||
error.param.order_type_empty=订单类型不能为空
|
||||
|
||||
# 市场相关参数错误
|
||||
error.param.token_id_empty=tokenId 不能为空
|
||||
error.param.condition_id_empty=conditionId 不能为空
|
||||
error.param.redeem_positions_empty=赎回仓位列表不能为空
|
||||
error.param.index_sets_invalid=结果索引无效
|
||||
|
||||
# 统计相关参数错误
|
||||
error.param.order_type_invalid_for_tracking=订单类型无效,必须是: buy, sell, matched
|
||||
|
||||
# ==================== 认证/权限错误 (2001-2999) ====================
|
||||
error.auth.error=认证失败
|
||||
error.auth.token_invalid=认证令牌无效
|
||||
error.auth.token_expired=认证令牌已过期
|
||||
error.auth.permission_denied=权限不足
|
||||
error.auth.api_key_invalid=API Key 无效
|
||||
error.auth.api_secret_invalid=API Secret 无效
|
||||
error.auth.api_passphrase_invalid=API Passphrase 无效
|
||||
error.auth.api_credentials_missing=API 凭证未配置
|
||||
error.auth.username_or_password_error=用户名或密码错误
|
||||
error.auth.reset_key_invalid=重置密钥错误
|
||||
error.auth.reset_password_rate_limit=频率限制:1分钟内最多尝试3次,请稍后再试
|
||||
error.auth.user_not_found=用户不存在
|
||||
error.auth.password_weak=密码长度不符合要求,至少6位
|
||||
|
||||
# ==================== 资源不存在 (3001-3999) ====================
|
||||
error.not_found=资源不存在
|
||||
error.account_not_found=账户不存在
|
||||
error.leader_not_found=Leader 不存在
|
||||
error.template_not_found=模板不存在
|
||||
error.copy_trading_not_found=跟单关系不存在
|
||||
error.market_not_found=市场不存在
|
||||
error.order_not_found=订单不存在
|
||||
error.position_not_found=仓位不存在
|
||||
|
||||
# ==================== 业务逻辑错误 (4001-4999) ====================
|
||||
error.business.error=业务逻辑错误
|
||||
|
||||
# Leader 管理
|
||||
error.leader_already_exists=该 Leader 地址已存在
|
||||
error.leader_address_same_as_account=Leader 地址不能与自己的账户地址相同
|
||||
error.leader_has_copy_tradings=该 Leader 还有跟单关系,请先删除跟单关系
|
||||
|
||||
# 模板管理
|
||||
error.template_name_already_exists=模板名称已存在
|
||||
error.template_has_copy_tradings=该模板还有跟单关系在使用,请先删除跟单关系
|
||||
|
||||
# 跟单管理
|
||||
error.copy_trading_already_exists=该跟单关系已存在
|
||||
error.copy_trading_disabled=跟单关系已禁用
|
||||
error.copy_trading_enabled=跟单关系已启用
|
||||
error.no_enabled_copy_tradings=没有启用的跟单关系
|
||||
|
||||
# 订单相关
|
||||
error.order_create_failed=创建订单失败
|
||||
error.order_cancel_failed=取消订单失败
|
||||
error.order_not_matched=订单未匹配
|
||||
error.order_already_filled=订单已成交
|
||||
error.order_insufficient_balance=余额不足
|
||||
error.order_amount_too_small=订单金额低于最小限制
|
||||
error.order_amount_too_large=订单金额超过最大限制
|
||||
error.order_price_invalid=订单价格无效
|
||||
error.order_quantity_invalid=订单数量无效
|
||||
|
||||
# 市场相关
|
||||
error.market_price_fetch_failed=获取市场价格失败
|
||||
error.market_orderbook_empty=订单簿为空
|
||||
error.market_token_id_invalid=Token ID 无效
|
||||
|
||||
# 仓位相关
|
||||
error.position_redeem_failed=赎回仓位失败
|
||||
error.position_not_redeemable=仓位不可赎回
|
||||
error.position_insufficient=仓位不足
|
||||
error.position_already_redeemed=仓位已赎回
|
||||
|
||||
# 通知配置相关
|
||||
error.notification_config_not_found=通知配置不存在
|
||||
error.notification_config_id_empty=配置ID不能为空
|
||||
error.notification_config_type_empty=推送类型不能为空
|
||||
error.notification_config_name_empty=配置名称不能为空
|
||||
error.notification_config_data_empty=配置信息不能为空
|
||||
error.notification_config_bot_token_empty=Bot Token 不能为空
|
||||
error.notification_config_create_failed=创建配置失败
|
||||
error.notification_config_update_failed=更新配置失败
|
||||
error.notification_config_delete_failed=删除配置失败
|
||||
error.notification_config_update_enabled_failed=更新启用状态失败
|
||||
error.notification_config_fetch_failed=获取配置失败
|
||||
error.notification_test_failed=发送测试消息失败,请检查配置
|
||||
error.notification_get_chat_ids_failed=获取 Chat IDs 失败
|
||||
|
||||
# 账户相关业务错误
|
||||
error.account_already_exists=账户已存在
|
||||
error.account_is_default=账户已是默认账户
|
||||
error.account_has_active_orders=账户有活跃订单
|
||||
error.account_is_last_one=不能删除最后一个账户
|
||||
error.account_api_key_create_failed=自动获取 API Key 失败
|
||||
error.account_proxy_address_fetch_failed=获取代理地址失败
|
||||
error.account_balance_fetch_failed=查询账户余额失败
|
||||
error.account_positions_fetch_failed=查询仓位列表失败
|
||||
|
||||
# 统计相关
|
||||
error.statistics_fetch_failed=获取统计信息失败
|
||||
error.order_list_fetch_failed=查询订单列表失败
|
||||
|
||||
# ==================== 服务器内部错误 (5001-5999) ====================
|
||||
error.server.error=服务器内部错误
|
||||
error.server.database_error=数据库错误
|
||||
error.server.network_error=网络错误
|
||||
error.server.timeout=请求超时
|
||||
error.server.external_api_error=外部API调用失败
|
||||
error.server.rpc_error=RPC调用失败
|
||||
error.server.websocket_error=WebSocket连接错误
|
||||
error.server.encryption_error=加密/解密错误
|
||||
error.server.signature_error=签名错误
|
||||
|
||||
# 账户服务错误
|
||||
error.server.account_import_failed=导入账户失败
|
||||
error.server.account_update_failed=更新账户失败
|
||||
error.server.account_delete_failed=删除账户失败
|
||||
error.server.account_list_fetch_failed=查询账户列表失败
|
||||
error.server.account_detail_fetch_failed=查询账户详情失败
|
||||
error.server.account_balance_fetch_failed=查询账户余额失败
|
||||
error.server.account_default_set_failed=设置默认账户失败
|
||||
error.server.account_positions_fetch_failed=查询仓位列表失败
|
||||
error.server.account_order_create_failed=创建卖出订单失败
|
||||
error.server.account_redeem_positions_failed=赎回仓位失败
|
||||
|
||||
# Leader 服务错误
|
||||
error.server.leader_add_failed=添加 Leader 失败
|
||||
error.server.leader_update_failed=更新 Leader 失败
|
||||
error.server.leader_delete_failed=删除 Leader 失败
|
||||
error.server.leader_list_fetch_failed=查询 Leader 列表失败
|
||||
error.server.leader_detail_fetch_failed=查询 Leader 详情失败
|
||||
|
||||
# 模板服务错误
|
||||
error.server.template_create_failed=创建模板失败
|
||||
error.server.template_update_failed=更新模板失败
|
||||
error.server.template_delete_failed=删除模板失败
|
||||
error.server.template_copy_failed=复制模板失败
|
||||
error.server.template_list_fetch_failed=查询模板列表失败
|
||||
error.server.template_detail_fetch_failed=查询模板详情失败
|
||||
|
||||
# 跟单服务错误
|
||||
error.server.copy_trading_create_failed=创建跟单失败
|
||||
error.server.copy_trading_update_failed=更新跟单失败
|
||||
error.server.copy_trading_delete_failed=删除跟单失败
|
||||
error.server.copy_trading_list_fetch_failed=查询跟单列表失败
|
||||
error.server.copy_trading_templates_fetch_failed=查询钱包绑定的模板失败
|
||||
|
||||
# 市场服务错误
|
||||
error.server.market_price_fetch_failed=获取市场价格失败
|
||||
error.server.market_latest_price_fetch_failed=获取最新价失败
|
||||
|
||||
# 统计服务错误
|
||||
error.server.statistics_fetch_failed=获取统计信息失败
|
||||
error.server.order_tracking_list_fetch_failed=查询订单列表失败
|
||||
|
||||
# 区块链服务错误
|
||||
error.server.blockchain_rpc_error=区块链RPC调用失败
|
||||
error.server.blockchain_proxy_address_fetch_failed=获取代理地址失败
|
||||
error.server.blockchain_balance_fetch_failed=查询余额失败
|
||||
error.server.blockchain_positions_fetch_failed=查询仓位失败
|
||||
error.server.blockchain_redeem_failed=赎回仓位交易失败
|
||||
|
||||
# WebSocket 服务错误
|
||||
error.server.websocket_connection_failed=WebSocket连接失败
|
||||
error.server.websocket_message_send_failed=WebSocket消息发送失败
|
||||
error.server.websocket_subscribe_failed=WebSocket订阅失败
|
||||
|
||||
# 订单跟踪服务错误
|
||||
error.server.order_tracking_process_failed=处理订单跟踪失败
|
||||
error.server.order_tracking_buy_failed=处理买入订单失败
|
||||
error.server.order_tracking_sell_failed=处理卖出订单失败
|
||||
error.server.order_tracking_match_failed=订单匹配失败
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
# 通知相關
|
||||
notification.order.created.success=訂單創建成功
|
||||
notification.order.created.failed=訂單創建失敗
|
||||
notification.order.info=訂單信息
|
||||
notification.order.id=訂單ID
|
||||
notification.order.market=市場
|
||||
notification.order.side=方向
|
||||
notification.order.side.buy=買入
|
||||
notification.order.side.sell=賣出
|
||||
notification.order.outcome=市場方向
|
||||
notification.order.price=價格
|
||||
notification.order.quantity=數量
|
||||
notification.order.amount=金額
|
||||
notification.order.account=賬戶
|
||||
notification.order.time=時間
|
||||
notification.order.error_info=錯誤信息
|
||||
notification.order.unknown_account=未知賬戶
|
||||
notification.order.calculate_failed=計算失敗
|
||||
|
||||
# 通用
|
||||
common.unknown=未知
|
||||
|
||||
# ==================== 參數錯誤 (1001-1999) ====================
|
||||
error.param.error=參數錯誤
|
||||
error.param.empty=參數不能為空
|
||||
error.param.invalid=參數無效
|
||||
|
||||
# 賬戶相關參數錯誤
|
||||
error.param.private_key_empty=私鑰不能為空
|
||||
error.param.wallet_address_empty=錢包地址不能為空
|
||||
error.param.wallet_address_invalid=錢包地址格式無效
|
||||
error.param.account_id_invalid=賬戶ID無效
|
||||
error.param.account_name_empty=賬戶名稱不能為空
|
||||
|
||||
# Leader 相關參數錯誤
|
||||
error.param.leader_address_empty=Leader 地址不能為空
|
||||
error.param.leader_address_invalid=Leader 地址格式無效
|
||||
error.param.leader_id_invalid=Leader ID 無效
|
||||
error.param.leader_name_empty=Leader 名稱不能為空
|
||||
error.param.category_invalid=分類無效,只支持 sports 或 crypto
|
||||
|
||||
# 模板相關參數錯誤
|
||||
error.param.template_name_empty=模板名稱不能為空
|
||||
error.param.template_id_invalid=模板 ID 無效
|
||||
error.param.copy_mode_invalid=copyMode 必須是 RATIO 或 FIXED
|
||||
error.param.copy_ratio_invalid=跟單比例無效
|
||||
error.param.fixed_amount_invalid=固定金額無效
|
||||
|
||||
# 跟單相關參數錯誤
|
||||
error.param.copy_trading_id_invalid=跟單關係ID無效
|
||||
error.param.order_type_invalid=訂單類型無效
|
||||
error.param.order_type_must_be_market_or_limit=訂單類型必須是MARKET或LIMIT
|
||||
error.param.quantity_empty=數量不能為空
|
||||
error.param.price_empty=限價訂單必須提供價格
|
||||
error.param.side_empty=方向不能為空
|
||||
error.param.market_id_empty=市場ID不能為空
|
||||
error.param.order_type_empty=訂單類型不能為空
|
||||
|
||||
# 市場相關參數錯誤
|
||||
error.param.token_id_empty=tokenId 不能為空
|
||||
error.param.condition_id_empty=conditionId 不能為空
|
||||
error.param.redeem_positions_empty=贖回倉位列表不能為空
|
||||
error.param.index_sets_invalid=結果索引無效
|
||||
|
||||
# 統計相關參數錯誤
|
||||
error.param.order_type_invalid_for_tracking=訂單類型無效,必須是: buy, sell, matched
|
||||
|
||||
# ==================== 認證/權限錯誤 (2001-2999) ====================
|
||||
error.auth.error=認證失敗
|
||||
error.auth.token_invalid=認證令牌無效
|
||||
error.auth.token_expired=認證令牌已過期
|
||||
error.auth.permission_denied=權限不足
|
||||
error.auth.api_key_invalid=API Key 無效
|
||||
error.auth.api_secret_invalid=API Secret 無效
|
||||
error.auth.api_passphrase_invalid=API Passphrase 無效
|
||||
error.auth.api_credentials_missing=API 憑證未配置
|
||||
error.auth.username_or_password_error=用戶名或密碼錯誤
|
||||
error.auth.reset_key_invalid=重置密鑰錯誤
|
||||
error.auth.reset_password_rate_limit=頻率限制:1分鐘內最多嘗試3次,請稍後再試
|
||||
error.auth.user_not_found=用戶不存在
|
||||
error.auth.password_weak=密碼長度不符合要求,至少6位
|
||||
|
||||
# ==================== 資源不存在 (3001-3999) ====================
|
||||
error.not_found=資源不存在
|
||||
error.account_not_found=賬戶不存在
|
||||
error.leader_not_found=Leader 不存在
|
||||
error.template_not_found=模板不存在
|
||||
error.copy_trading_not_found=跟單關係不存在
|
||||
error.market_not_found=市場不存在
|
||||
error.order_not_found=訂單不存在
|
||||
error.position_not_found=倉位不存在
|
||||
|
||||
# ==================== 業務邏輯錯誤 (4001-4999) ====================
|
||||
error.business.error=業務邏輯錯誤
|
||||
|
||||
# Leader 管理
|
||||
error.leader_already_exists=該 Leader 地址已存在
|
||||
error.leader_address_same_as_account=Leader 地址不能與自己的賬戶地址相同
|
||||
error.leader_has_copy_tradings=該 Leader 還有跟單關係,請先刪除跟單關係
|
||||
|
||||
# 模板管理
|
||||
error.template_name_already_exists=模板名稱已存在
|
||||
error.template_has_copy_tradings=該模板還有跟單關係在使用,請先刪除跟單關係
|
||||
|
||||
# 跟單管理
|
||||
error.copy_trading_already_exists=該跟單關係已存在
|
||||
error.copy_trading_disabled=跟單關係已禁用
|
||||
error.copy_trading_enabled=跟單關係已啟用
|
||||
error.no_enabled_copy_tradings=沒有啟用的跟單關係
|
||||
|
||||
# 訂單相關
|
||||
error.order_create_failed=創建訂單失敗
|
||||
error.order_cancel_failed=取消訂單失敗
|
||||
error.order_not_matched=訂單未匹配
|
||||
error.order_already_filled=訂單已成交
|
||||
error.order_insufficient_balance=餘額不足
|
||||
error.order_amount_too_small=訂單金額低於最小限制
|
||||
error.order_amount_too_large=訂單金額超過最大限制
|
||||
error.order_price_invalid=訂單價格無效
|
||||
error.order_quantity_invalid=訂單數量無效
|
||||
|
||||
# 市場相關
|
||||
error.market_price_fetch_failed=獲取市場價格失敗
|
||||
error.market_orderbook_empty=訂單簿為空
|
||||
error.market_token_id_invalid=Token ID 無效
|
||||
|
||||
# 倉位相關
|
||||
error.position_redeem_failed=贖回倉位失敗
|
||||
error.position_not_redeemable=倉位不可贖回
|
||||
error.position_insufficient=倉位不足
|
||||
error.position_already_redeemed=倉位已贖回
|
||||
|
||||
# 通知配置相關
|
||||
error.notification_config_not_found=通知配置不存在
|
||||
error.notification_config_id_empty=配置ID不能為空
|
||||
error.notification_config_type_empty=推送類型不能為空
|
||||
error.notification_config_name_empty=配置名稱不能為空
|
||||
error.notification_config_data_empty=配置信息不能為空
|
||||
error.notification_config_bot_token_empty=Bot Token 不能為空
|
||||
error.notification_config_create_failed=創建配置失敗
|
||||
error.notification_config_update_failed=更新配置失敗
|
||||
error.notification_config_delete_failed=刪除配置失敗
|
||||
error.notification_config_update_enabled_failed=更新啟用狀態失敗
|
||||
error.notification_config_fetch_failed=獲取配置失敗
|
||||
error.notification_test_failed=發送測試消息失敗,請檢查配置
|
||||
error.notification_get_chat_ids_failed=獲取 Chat IDs 失敗
|
||||
|
||||
# 賬戶相關業務錯誤
|
||||
error.account_already_exists=賬戶已存在
|
||||
error.account_is_default=賬戶已是默認賬戶
|
||||
error.account_has_active_orders=賬戶有活躍訂單
|
||||
error.account_is_last_one=不能刪除最後一個賬戶
|
||||
error.account_api_key_create_failed=自動獲取 API Key 失敗
|
||||
error.account_proxy_address_fetch_failed=獲取代理地址失敗
|
||||
error.account_balance_fetch_failed=查詢賬戶餘額失敗
|
||||
error.account_positions_fetch_failed=查詢倉位列表失敗
|
||||
|
||||
# 統計相關
|
||||
error.statistics_fetch_failed=獲取統計信息失敗
|
||||
error.order_list_fetch_failed=查詢訂單列表失敗
|
||||
|
||||
# ==================== 服務器內部錯誤 (5001-5999) ====================
|
||||
error.server.error=服務器內部錯誤
|
||||
error.server.database_error=數據庫錯誤
|
||||
error.server.network_error=網絡錯誤
|
||||
error.server.timeout=請求超時
|
||||
error.server.external_api_error=外部API調用失敗
|
||||
error.server.rpc_error=RPC調用失敗
|
||||
error.server.websocket_error=WebSocket連接錯誤
|
||||
error.server.encryption_error=加密/解密錯誤
|
||||
error.server.signature_error=簽名錯誤
|
||||
|
||||
# 賬戶服務錯誤
|
||||
error.server.account_import_failed=導入賬戶失敗
|
||||
error.server.account_update_failed=更新賬戶失敗
|
||||
error.server.account_delete_failed=刪除賬戶失敗
|
||||
error.server.account_list_fetch_failed=查詢賬戶列表失敗
|
||||
error.server.account_detail_fetch_failed=查詢賬戶詳情失敗
|
||||
error.server.account_balance_fetch_failed=查詢賬戶餘額失敗
|
||||
error.server.account_default_set_failed=設置默認賬戶失敗
|
||||
error.server.account_positions_fetch_failed=查詢倉位列表失敗
|
||||
error.server.account_order_create_failed=創建賣出訂單失敗
|
||||
error.server.account_redeem_positions_failed=贖回倉位失敗
|
||||
|
||||
# Leader 服務錯誤
|
||||
error.server.leader_add_failed=添加 Leader 失敗
|
||||
error.server.leader_update_failed=更新 Leader 失敗
|
||||
error.server.leader_delete_failed=刪除 Leader 失敗
|
||||
error.server.leader_list_fetch_failed=查詢 Leader 列表失敗
|
||||
error.server.leader_detail_fetch_failed=查詢 Leader 詳情失敗
|
||||
|
||||
# 模板服務錯誤
|
||||
error.server.template_create_failed=創建模板失敗
|
||||
error.server.template_update_failed=更新模板失敗
|
||||
error.server.template_delete_failed=刪除模板失敗
|
||||
error.server.template_copy_failed=複製模板失敗
|
||||
error.server.template_list_fetch_failed=查詢模板列表失敗
|
||||
error.server.template_detail_fetch_failed=查詢模板詳情失敗
|
||||
|
||||
# 跟單服務錯誤
|
||||
error.server.copy_trading_create_failed=創建跟單失敗
|
||||
error.server.copy_trading_update_failed=更新跟單失敗
|
||||
error.server.copy_trading_delete_failed=刪除跟單失敗
|
||||
error.server.copy_trading_list_fetch_failed=查詢跟單列表失敗
|
||||
error.server.copy_trading_templates_fetch_failed=查詢錢包綁定的模板失敗
|
||||
|
||||
# 市場服務錯誤
|
||||
error.server.market_price_fetch_failed=獲取市場價格失敗
|
||||
error.server.market_latest_price_fetch_failed=獲取最新價失敗
|
||||
|
||||
# 統計服務錯誤
|
||||
error.server.statistics_fetch_failed=獲取統計信息失敗
|
||||
error.server.order_tracking_list_fetch_failed=查詢訂單列表失敗
|
||||
|
||||
# 區塊鏈服務錯誤
|
||||
error.server.blockchain_rpc_error=區塊鏈RPC調用失敗
|
||||
error.server.blockchain_proxy_address_fetch_failed=獲取代理地址失敗
|
||||
error.server.blockchain_balance_fetch_failed=查詢餘額失敗
|
||||
error.server.blockchain_positions_fetch_failed=查詢倉位失敗
|
||||
error.server.blockchain_redeem_failed=贖回倉位交易失敗
|
||||
|
||||
# WebSocket 服務錯誤
|
||||
error.server.websocket_connection_failed=WebSocket連接失敗
|
||||
error.server.websocket_message_send_failed=WebSocket消息發送失敗
|
||||
error.server.websocket_subscribe_failed=WebSocket訂閱失敗
|
||||
|
||||
# 訂單跟蹤服務錯誤
|
||||
error.server.order_tracking_process_failed=處理訂單跟蹤失敗
|
||||
error.server.order_tracking_buy_failed=處理買入訂單失敗
|
||||
error.server.order_tracking_sell_failed=處理賣出訂單失敗
|
||||
error.server.order_tracking_match_failed=訂單匹配失敗
|
||||
|
||||
Reference in New Issue
Block a user