From fea67d05eb3538ae517711036303ad5e200c8f7d Mon Sep 17 00:00:00 2001 From: AskaEth Date: Tue, 23 Jun 2026 20:19:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20reminder=E5=B7=A5=E5=85=B7401=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=20=E2=80=94=20=E8=B7=AF=E7=94=B1=E4=BB=8EJWT=E7=BB=84?= =?UTF-8?q?=E8=BF=81=E5=88=B0internal=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Gateway新增 /api/v1/internal/reminders (GET/POST/DELETE) - 使用 X-Internal-Token 认证,不再需要JWT - GatewayClient URL改为 /api/v1/internal/reminders Co-Authored-By: Claude --- backend/ai-core/internal/tools/gateway_client.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/ai-core/internal/tools/gateway_client.go b/backend/ai-core/internal/tools/gateway_client.go index fd69e90..91dfc0c 100644 --- a/backend/ai-core/internal/tools/gateway_client.go +++ b/backend/ai-core/internal/tools/gateway_client.go @@ -37,7 +37,7 @@ type Reminder struct { RepeatType string `json:"repeat_type"` } -// CreateReminder calls POST /api/v1/reminders on the Gateway. +// CreateReminder calls POST /api/v1/internal/reminders on the Gateway. func (c *GatewayClient) CreateReminder(ctx context.Context, userID, title, description, remindAt, repeatType, sessionID string) (*Reminder, error) { body := map[string]interface{}{ "user_id": userID, @@ -49,7 +49,7 @@ func (c *GatewayClient) CreateReminder(ctx context.Context, userID, title, descr } reqBody, _ := json.Marshal(body) - req, err := http.NewRequestWithContext(ctx, "POST", c.baseURL+"/api/v1/reminders", bytes.NewReader(reqBody)) + req, err := http.NewRequestWithContext(ctx, "POST", c.baseURL+"/api/v1/internal/reminders", bytes.NewReader(reqBody)) if err != nil { return nil, err } @@ -74,9 +74,9 @@ func (c *GatewayClient) CreateReminder(ctx context.Context, userID, title, descr return &reminder, nil } -// ListReminders calls GET /api/v1/reminders on the Gateway. +// ListReminders calls GET /api/v1/internal/reminders on the Gateway. func (c *GatewayClient) ListReminders(ctx context.Context, userID, status string, limit int) ([]Reminder, error) { - url := fmt.Sprintf("%s/api/v1/reminders?user_id=%s&status=%s&limit=%d", c.baseURL, userID, status, limit) + url := fmt.Sprintf("%s/api/v1/internal/reminders?user_id=%s&status=%s&limit=%d", c.baseURL, userID, status, limit) req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, err @@ -101,9 +101,9 @@ func (c *GatewayClient) ListReminders(ctx context.Context, userID, status string return reminders, nil } -// DeleteReminder calls DELETE /api/v1/reminders/:id on the Gateway. +// DeleteReminder calls DELETE /api/v1/internal/reminders/:id on the Gateway. func (c *GatewayClient) DeleteReminder(ctx context.Context, reminderID string) error { - req, err := http.NewRequestWithContext(ctx, "DELETE", c.baseURL+"/api/v1/reminders/"+reminderID, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", c.baseURL+"/api/v1/internal/reminders/"+reminderID, nil) if err != nil { return err }