From 3ed17bb4eb4d2b5f1743365f552e708d9ab41d0a Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 24 Dec 2025 01:20:43 -0800 Subject: [PATCH] =?UTF-8?q?fix(notification):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=B8=AD=E5=BF=83API=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: 前端调用 /admin-service/mobile/notifications 路径不存在于Kong网关 修复: 1. Kong网关添加 /api/v1/mobile/notifications 路由到 admin-service 2. 前端 NotificationService 修正 API 路径: - /admin-service/mobile/notifications -> /mobile/notifications - /admin-service/mobile/notifications/unread-count -> /mobile/notifications/unread-count - /admin-service/mobile/notifications/mark-read -> /mobile/notifications/mark-read 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- backend/api-gateway/kong.yml | 6 +++++- .../mobile-app/lib/core/services/notification_service.dart | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/api-gateway/kong.yml b/backend/api-gateway/kong.yml index 83cfc7dd..5ca7762a 100644 --- a/backend/api-gateway/kong.yml +++ b/backend/api-gateway/kong.yml @@ -190,7 +190,7 @@ services: strip_path: false # --------------------------------------------------------------------------- - # Admin Service - 管理服务 (包含版本管理) + # Admin Service - 管理服务 (包含版本管理和通知) # --------------------------------------------------------------------------- - name: admin-service url: http://192.168.1.111:3010 @@ -211,6 +211,10 @@ services: paths: - /downloads strip_path: false + - name: admin-mobile-notifications + paths: + - /api/v1/mobile/notifications + strip_path: false # --------------------------------------------------------------------------- # Presence Service - 在线状态服务 diff --git a/frontend/mobile-app/lib/core/services/notification_service.dart b/frontend/mobile-app/lib/core/services/notification_service.dart index fb4dfb11..0e76768d 100644 --- a/frontend/mobile-app/lib/core/services/notification_service.dart +++ b/frontend/mobile-app/lib/core/services/notification_service.dart @@ -175,7 +175,7 @@ class NotificationService { } final response = await _apiClient.get( - '/admin-service/mobile/notifications', + '/mobile/notifications', queryParameters: queryParams, ); @@ -190,7 +190,7 @@ class NotificationService { Future getUnreadCount({required String userSerialNum}) async { try { final response = await _apiClient.get( - '/admin-service/mobile/notifications/unread-count', + '/mobile/notifications/unread-count', queryParameters: {'userSerialNum': userSerialNum}, ); @@ -213,7 +213,7 @@ class NotificationService { }; final response = await _apiClient.post( - '/admin-service/mobile/notifications/mark-read', + '/mobile/notifications/mark-read', data: body, );