mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 15:34:16 +08:00
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:
@@ -1292,7 +1292,7 @@ def update_email_smtp(req: EmailSmtpPrefsIn) -> dict:
|
|||||||
else req.password
|
else req.password
|
||||||
)
|
)
|
||||||
if username and not effective_password:
|
if username and not effective_password:
|
||||||
raise HTTPException(status_code=400, detail="已填写 SMTP 登录用户名,请同时填写密码或授权码")
|
raise HTTPException(status_code=400, detail="已填写 SMTP 登录用户名, 请同时填写密码或授权码")
|
||||||
else:
|
else:
|
||||||
username = ""
|
username = ""
|
||||||
from_address = ""
|
from_address = ""
|
||||||
@@ -1353,9 +1353,9 @@ def test_webhook(req: WebhookTestIn) -> dict:
|
|||||||
elif req.channel == "custom":
|
elif req.channel == "custom":
|
||||||
url = preferences.get_custom_webhook_url()
|
url = preferences.get_custom_webhook_url()
|
||||||
if not url:
|
if not url:
|
||||||
return {"ok": False, "detail": "尚未配置第三方 Webhook,请先保存"}
|
return {"ok": False, "detail": "尚未配置第三方 Webhook, 请先保存"}
|
||||||
if not webhook_adapter.is_valid_custom_url(url):
|
if not webhook_adapter.is_valid_custom_url(url):
|
||||||
return {"ok": False, "detail": "已保存的第三方 Webhook 地址非法,请重新保存"}
|
return {"ok": False, "detail": "已保存的第三方 Webhook 地址非法, 请重新保存"}
|
||||||
ok = webhook_adapter.send_custom(
|
ok = webhook_adapter.send_custom(
|
||||||
url,
|
url,
|
||||||
title,
|
title,
|
||||||
@@ -1369,7 +1369,7 @@ def test_webhook(req: WebhookTestIn) -> dict:
|
|||||||
|
|
||||||
config = preferences.get_email_smtp_config()
|
config = preferences.get_email_smtp_config()
|
||||||
if not email_adapter.is_configured(config):
|
if not email_adapter.is_configured(config):
|
||||||
return {"ok": False, "detail": "尚未完整配置邮件 SMTP,请先保存"}
|
return {"ok": False, "detail": "尚未完整配置邮件 SMTP, 请先保存"}
|
||||||
ok = email_adapter.send_email(
|
ok = email_adapter.send_email(
|
||||||
config,
|
config,
|
||||||
secrets_store.get_email_smtp_password(),
|
secrets_store.get_email_smtp_password(),
|
||||||
@@ -1379,7 +1379,7 @@ def test_webhook(req: WebhookTestIn) -> dict:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if ok:
|
if ok:
|
||||||
return {"ok": True, "detail": "测试消息已发送,请检查对应接收端"}
|
return {"ok": True, "detail": "测试消息已发送, 请检查对应接收端"}
|
||||||
return {"ok": False, "detail": "推送失败:网络不可达或地址/密钥不正确,详情见后端日志"}
|
return {"ok": False, "detail": "推送失败:网络不可达或地址/密钥不正确,详情见后端日志"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -177,18 +177,6 @@ export interface LevelSeries {
|
|||||||
atr?: { stop_loss: (number | null)[]; take_profit: (number | null)[] }
|
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 {
|
export interface StockLevels {
|
||||||
levels: Record<LevelType, PriceLevel[]>
|
levels: Record<LevelType, PriceLevel[]>
|
||||||
close: number | null
|
close: number | null
|
||||||
@@ -197,8 +185,6 @@ export interface StockLevels {
|
|||||||
/** dates 与 series 对齐;前端按自身 rows 的日期映射,缺失填 null */
|
/** dates 与 series 对齐;前端按自身 rows 的日期映射,缺失填 null */
|
||||||
dates?: string[]
|
dates?: string[]
|
||||||
series?: LevelSeries
|
series?: LevelSeries
|
||||||
/** 疑似主力成本统计估算;旧后端响应可能不存在该字段 */
|
|
||||||
main_cost?: MainCostEstimate
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AiStockReport {
|
export interface AiStockReport {
|
||||||
|
|||||||
Reference in New Issue
Block a user