style: 全局将 USDC 展示替换为 $ 符号

前端所有金额展示从 "100.00 USDC" 改为 "$100.00" 格式,
后端 Telegram 通知模板和错误提示同步更新。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
WrBug
2026-04-28 22:23:49 +08:00
co-authored by Claude Opus 4.7
parent 0769022878
commit 8ab8ae5205
31 changed files with 169 additions and 181 deletions
@@ -267,7 +267,7 @@ class CryptoTailStrategyController(
"当前周期已下单" -> ErrorCode.PARAM_ERROR
"价格必须在 0~1 之间" -> ErrorCode.PARAM_ERROR
"数量不能少于 1" -> ErrorCode.PARAM_ERROR
"总金额不能少于 1 USDC" -> ErrorCode.PARAM_ERROR
"总金额不能少于 $1" -> ErrorCode.PARAM_ERROR
"总金额超过策略配置的投入金额" -> ErrorCode.PARAM_ERROR
else -> ErrorCode.SERVER_ERROR
}
@@ -702,7 +702,7 @@ class CryptoTailStrategyExecutionService(
val amountUsdc = priceRounded.multi(size).setScale(2, RoundingMode.HALF_UP)
if (amountUsdc < BigDecimal.ONE) {
return Result.failure(IllegalArgumentException("总金额不能少于 1 USDC"))
return Result.failure(IllegalArgumentException("总金额不能少于 \$1"))
}
val mutex = getTriggerMutex(strategy.id!!, request.periodStartUnix)
@@ -169,9 +169,9 @@ class NotificationTemplateService(
• 方向: <b>{{side}}</b>
• 价格: <code>{{price}}</code>
• 数量: <code>{{quantity}}</code> shares
• 金额: <code>{{amount}}</code> USDC
• 金额: <code>${'$'}{{amount}}</code>
• 账户: {{account_name}}
• 可用余额: <code>{{available_balance}}</code> USDC
• 可用余额: <code>${'$'}{{available_balance}}</code>
⏰ 时间: <code>{{time}}</code>
""".trimIndent(),
@@ -184,7 +184,7 @@ class NotificationTemplateService(
• 方向: <b>{{side}}</b>
• 价格: <code>{{price}}</code>
• 数量: <code>{{quantity}}</code> shares
• 金额: <code>{{amount}}</code> USDC
• 金额: <code>${'$'}{{amount}}</code>
• 账户: {{account_name}}
⚠️ <b>错误信息:</b>
@@ -201,7 +201,7 @@ class NotificationTemplateService(
• 方向: <b>{{side}}</b>
• 价格: <code>{{price}}</code>
• 数量: <code>{{quantity}}</code> shares
• 金额: <code>{{amount}}</code> USDC
• 金额: <code>${'$'}{{amount}}</code>
• 账户: {{account_name}}
⚠️ <b>过滤类型:</b> <code>{{filter_type}}</code>
@@ -222,7 +222,7 @@ class NotificationTemplateService(
• 方向: <b>{{side}}</b>
• 价格: <code>{{price}}</code>
• 数量: <code>{{quantity}}</code> shares
• 金额: <code>{{amount}}</code> USDC
• 金额: <code>${'$'}{{amount}}</code>
• 账户: {{account_name}}
⏰ 时间: <code>{{time}}</code>
@@ -233,8 +233,8 @@ class NotificationTemplateService(
📊 <b>赎回信息:</b>
• 账户: {{account_name}}
• 交易哈希: <code>{{transaction_hash}}</code>
• 赎回总价值: <code>{{total_value}}</code> USDC
• 可用余额: <code>{{available_balance}}</code> USDC
• 赎回总价值: <code>${'$'}{{total_value}}</code>
• 可用余额: <code>${'$'}{{available_balance}}</code>
⏰ 时间: <code>{{time}}</code>
""".trimIndent(),
@@ -246,7 +246,7 @@ class NotificationTemplateService(
• 账户: {{account_name}}
• 交易哈希: <code>{{transaction_hash}}</code>
• 可用余额: <code>{{available_balance}}</code> USDC
• 可用余额: <code>${'$'}{{available_balance}}</code>
⏰ 时间: <code>{{time}}</code>
""".trimIndent()
@@ -691,7 +691,7 @@ class TelegramNotificationService(
$sideLabel: <b>$sideDisplay</b>
$priceLabel: <code>$priceDisplay</code>
$quantityLabel: <code>$sizeDisplay</code> shares
$amountLabel: <code>$amountDisplay</code> USDC
$amountLabel: <code>${'$'}$amountDisplay</code>
$accountLabel: $escapedAccountInfo
⚠️ <b>$filterTypeLabel</b> <code>$filterTypeDisplay</code>
@@ -1169,9 +1169,9 @@ class TelegramNotificationService(
} else {
balanceDecimal.stripTrailingZeros()
}
"\n$availableBalanceLabel: <code>${formatted.toPlainString()}</code> USDC"
"\n$availableBalanceLabel: <code>${'$'}${formatted.toPlainString()}</code>"
} catch (e: Exception) {
"\n$availableBalanceLabel: <code>$availableBalance</code> USDC"
"\n$availableBalanceLabel: <code>${'$'}$availableBalance</code>"
}
} else {
""
@@ -1185,7 +1185,7 @@ class TelegramNotificationService(
$sideLabel: <b>$sideDisplay</b>
$priceLabel: <code>$priceDisplay</code>
$quantityLabel: <code>$sizeDisplay</code> shares
$amountLabel: <code>$amountDisplay</code> USDC
$amountLabel: <code>${'$'}$amountDisplay</code>
$accountLabel: $escapedAccountInfo$escapedCopyTradingInfo$availableBalanceDisplay
$timeLabel: <code>$time</code>"""
@@ -1264,7 +1264,7 @@ class TelegramNotificationService(
$sideLabel: <b>$sideDisplay</b>
$priceLabel: <code>$priceDisplay</code>
$quantityLabel: <code>$sizeDisplay</code> shares
$amountLabel: <code>$amountDisplay</code> USDC
$amountLabel: <code>${'$'}$amountDisplay</code>
$accountLabel: $escapedAccountInfo
$timeLabel: <code>$time</code>"""
@@ -1381,7 +1381,7 @@ class TelegramNotificationService(
$sideLabel: <b>$sideDisplay</b>
$priceLabel: <code>$priceDisplay</code>
$quantityLabel: <code>$sizeDisplay</code> shares
$amountLabel: <code>$amountDisplay</code> USDC
$amountLabel: <code>${'$'}$amountDisplay</code>
$accountLabel: $escapedAccountInfo
⚠️ <b>$errorInfo</b>
@@ -1515,7 +1515,7 @@ class TelegramNotificationService(
} catch (e: Exception) {
position.value
}
"${position.marketId.substring(0, 8)}... (${position.side}): $quantityDisplay shares = $valueDisplay USDC"
"${position.marketId.substring(0, 8)}... (${position.side}): $quantityDisplay shares = ${'$'}$valueDisplay"
}
// 格式化可用余额
@@ -1527,9 +1527,9 @@ class TelegramNotificationService(
} else {
balanceDecimal.stripTrailingZeros()
}
"\n$availableBalanceLabel: <code>${formatted.toPlainString()}</code> USDC"
"\n$availableBalanceLabel: <code>${'$'}${formatted.toPlainString()}</code>"
} catch (e: Exception) {
"\n$availableBalanceLabel: <code>$availableBalance</code> USDC"
"\n$availableBalanceLabel: <code>${'$'}$availableBalance</code>"
}
} else {
""
@@ -1540,7 +1540,7 @@ class TelegramNotificationService(
📊 <b>$redeemInfo</b>
$accountLabel: $escapedAccountInfo
$transactionHashLabel: <code>$escapedTxHash</code>
$totalValueLabel: <code>$totalValueDisplay</code> USDC$availableBalanceDisplay
$totalValueLabel: <code>${'$'}$totalValueDisplay</code>$availableBalanceDisplay
📦 <b>$positionsLabel</b>
$positionsText
@@ -1642,9 +1642,9 @@ $positionsText
} else {
balanceDecimal.stripTrailingZeros()
}
"\n$availableBalanceLabel: <code>${formatted.toPlainString()}</code> USDC"
"\n$availableBalanceLabel: <code>${'$'}${formatted.toPlainString()}</code>"
} catch (e: Exception) {
"\n$availableBalanceLabel: <code>$availableBalance</code> USDC"
"\n$availableBalanceLabel: <code>${'$'}$availableBalance</code>"
}
} else {
""