fix(notifications): #244 维护者补丁 — 移除预埋类型并修正全角标点

- 移除 api.ts 中与通知无关的 MainCostEstimate/StockLevels.main_cost 类型(对应后端字段在本仓库不存在, 属跨 PR 预埋, 全仓库零引用)
- settings.py 5 处 PR 新增字符串的全角逗号改半角, RUF001 恢复到 main 基线(28 ≤ 29)
- 验证: 通知测试 48 passed, 前端 build 通过
This commit is contained in:
shy3130
2026-09-05 17:16:58 +08:00
parent c1cad36449
commit 2ff909cd36
2 changed files with 5 additions and 19 deletions
+5 -5
View File
@@ -1292,7 +1292,7 @@ def update_email_smtp(req: EmailSmtpPrefsIn) -> dict:
else req.password
)
if username and not effective_password:
raise HTTPException(status_code=400, detail="已填写 SMTP 登录用户名请同时填写密码或授权码")
raise HTTPException(status_code=400, detail="已填写 SMTP 登录用户名, 请同时填写密码或授权码")
else:
username = ""
from_address = ""
@@ -1353,9 +1353,9 @@ def test_webhook(req: WebhookTestIn) -> dict:
elif req.channel == "custom":
url = preferences.get_custom_webhook_url()
if not url:
return {"ok": False, "detail": "尚未配置第三方 Webhook请先保存"}
return {"ok": False, "detail": "尚未配置第三方 Webhook, 请先保存"}
if not webhook_adapter.is_valid_custom_url(url):
return {"ok": False, "detail": "已保存的第三方 Webhook 地址非法请重新保存"}
return {"ok": False, "detail": "已保存的第三方 Webhook 地址非法, 请重新保存"}
ok = webhook_adapter.send_custom(
url,
title,
@@ -1369,7 +1369,7 @@ def test_webhook(req: WebhookTestIn) -> dict:
config = preferences.get_email_smtp_config()
if not email_adapter.is_configured(config):
return {"ok": False, "detail": "尚未完整配置邮件 SMTP请先保存"}
return {"ok": False, "detail": "尚未完整配置邮件 SMTP, 请先保存"}
ok = email_adapter.send_email(
config,
secrets_store.get_email_smtp_password(),
@@ -1379,7 +1379,7 @@ def test_webhook(req: WebhookTestIn) -> dict:
)
if ok:
return {"ok": True, "detail": "测试消息已发送请检查对应接收端"}
return {"ok": True, "detail": "测试消息已发送, 请检查对应接收端"}
return {"ok": False, "detail": "推送失败:网络不可达或地址/密钥不正确,详情见后端日志"}
-14
View File
@@ -177,18 +177,6 @@ export interface LevelSeries {
atr?: { stop_loss: (number | null)[]; take_profit: (number | null)[] }
}
export interface MainCostEstimate {
estimated_main_cost: number | null
main_cost_peak: number | null
main_core_cost_low: number | null
main_core_cost_high: number | null
/** 小数制:0.10 表示估算浮盈 10% */
main_profit_rate: number | null
main_net_amount: number
/** 0~1,表示输入数据完整度,不是结果真实准确率 */
confidence: number
}
export interface StockLevels {
levels: Record<LevelType, PriceLevel[]>
close: number | null
@@ -197,8 +185,6 @@ export interface StockLevels {
/** dates 与 series 对齐;前端按自身 rows 的日期映射,缺失填 null */
dates?: string[]
series?: LevelSeries
/** 疑似主力成本统计估算;旧后端响应可能不存在该字段 */
main_cost?: MainCostEstimate
}
export interface AiStockReport {