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
@@ -35,7 +35,11 @@ type CreateReminderRequest struct {
RemindAt string `json:"remind_at" binding:"required"` // ISO 8601 格式
RepeatType string `json:"repeat_type"` // none, daily, weekly, monthly
SessionID string `json:"session_id"`
UserID string `json:"user_id,omitempty"` // 内部调用时直接传 userID
UserID string `json:"user_id,omitempty"`
Platform string `json:"platform,omitempty"`
ChannelType string `json:"channel_type,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
AdapterName string `json:"adapter_name,omitempty"` // 内部调用时直接传 userID
}
// UpdateReminderRequest 更新提醒请求体
@@ -129,6 +133,10 @@ func (h *ReminderHandler) Create(c *gin.Context) {
Status: "pending",
RepeatType: repeatType,
SessionID: req.SessionID,
Platform: req.Platform,
ChannelType: req.ChannelType,
ChannelID: req.ChannelID,
AdapterName: req.AdapterName,
Notified: false,
}
@@ -356,10 +364,14 @@ func calculateNextRemindAt(current time.Time, repeatType string) time.Time {
func triggerLLMReminder(aiCoreURL, internalToken string, r store.Reminder) {
body := map[string]string{
"title": r.Title,
"description": r.Description,
"user_id": r.UserID,
"session_id": r.SessionID,
"title": r.Title,
"description": r.Description,
"user_id": r.UserID,
"session_id": r.SessionID,
"platform": r.Platform,
"channel_type": r.ChannelType,
"channel_id": r.ChannelID,
"adapter_name": r.AdapterName,
}
reqBody, _ := json.Marshal(body)
req, err := http.NewRequest("POST", aiCoreURL+"/api/v1/internal/reminder-trigger", bytes.NewReader(reqBody))