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
View File
@@ -8,6 +8,7 @@ import (
"log/slog"
"strconv"
"strings"
"time"
"aiaa-notification-service/internal/condition"
"aiaa-notification-service/internal/engine"
@@ -85,6 +86,9 @@ func (s *Service) Process(ctx context.Context, req Request) (Result, error) {
if _, ok := req.Data["event"]; !ok && req.Event != "" {
req.Data["event"] = req.Event
}
if _, ok := req.Data["pushedAt"]; !ok {
req.Data["pushedAt"] = time.Now().In(time.Local).Format("2006.01.02 15:04:05")
}
content, err := s.renderer.Render(tmpl.Content, req.Data)
if err != nil {