feat(通知): SafeW 只发正文并注入推送时间

去掉渠道标题前缀,模板可用 pushedAt 显示本地推送时间。
This commit is contained in:
2026-08-16 01:18:27 +08:00
parent a9b6234208
commit 14504af950
5 changed files with 42 additions and 6 deletions
+4 -2
View File
@@ -307,9 +307,11 @@ Body 同创建。成功:`{"ok": true}`
```
### {{.symbol}} {{case .action "OPEN" "开仓" "CLOSE" "平仓" "GAIN" "止盈" "SELL" "卖出" "ADD" "加仓" "REDUCE" "减仓"}}
{{line "币种" .symbol}}{{line "周期" .period}}{{line "方向" .side}}{{line "价格" .price}}{{line "平均价" .totalAvgPx}}{{line "止盈价" .takeProfitPrice}}{{line "止损价" .stopLossPrice}}
{{line "币种" .symbol}}{{line "周期" .period}}{{line "方向" .side}}{{line "价格" .price}}{{line "平均价" .totalAvgPx}}{{line "止盈价" .takeProfitPrice}}{{line "止损价" .stopLossPrice}}{{line "推送时间" .pushedAt}}
```
渲染时会自动注入 `event``pushedAt`(本地时间 `2006.01.02 15:04:05`)。
也可用事件名:`{{case .event ".open" "开仓" ".close" "平仓"}}`
等价写法:`{{with .totalAvgPx}}平均价:{{.}}{{end}}`
@@ -426,7 +428,7 @@ SMTP 使用全局 `config.yaml` 的 `smtp` 段;支持 587 STARTTLS / 465 TLS
}
```
`chat_id` 可为数字或字符串(含 `@username`)。消息以纯文本发送不做 Markdown 转义。
`chat_id` 可为数字或字符串(含 `@username`)。消息以纯文本发送正文,不附带 `{source}: {event}` 标题,也不做 Markdown 转义。
#### `POST /api/v1/channels/safew/chats` — 列出已监控的 SafeW 群