feat: 群聊提醒 — 提醒关联平台/频道/适配器,到期发回原群聊

- reminder_create 新增 platform/channel_type/channel_id/adapter_name 参数
- Gateway Reminder 模型 + DB 迁移 + CRUD 全部支持新字段
- 提醒到期时:群聊提醒 → platform-bridge 发回原群聊
- 非群聊提醒 → 走 Web 端推送
- Thinker 新增 PushPlatformMessage 方法

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-06-23 20:57:58 +08:00
parent 680696e2c4
commit 27a497e397
6 changed files with 77 additions and 15 deletions
+20 -1
View File
@@ -547,6 +547,10 @@ func main() {
Description string `json:"description"`
UserID string `json:"user_id"`
SessionID string `json:"session_id"`
Platform string `json:"platform,omitempty"`
ChannelType string `json:"channel_type,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
AdapterName string `json:"adapter_name,omitempty"`
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
w.WriteHeader(http.StatusBadRequest)
@@ -580,7 +584,22 @@ func main() {
// Push through the message pusher if available.
if thinker != nil {
thinker.TriggerReminderMessage(req.UserID, req.SessionID, reminderMsg)
// If group reminder, push through platform-bridge via thinker
if req.Platform != "" && req.ChannelID != "" {
target := background.ProactiveTarget{
Platform: req.Platform,
ChatType: req.ChannelType,
GroupID: req.ChannelID,
}
if req.AdapterName != "" {
target.Platform = req.AdapterName
}
thinker.PushPlatformMessage(target, reminderMsg)
}
// 只有非群聊提醒才推Web端(群聊提醒已通过platform-bridge发送)
if req.Platform == "" {
thinker.TriggerReminderMessage(req.UserID, req.SessionID, reminderMsg)
}
}
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(`{"status":"ok"}`))