feat(notification): 通知标题和正文支持多语言

- 通知静态配置支持 title/body i18n
- 前端通知列表和详情页展示本地化内容
- 新增数据库迁移脚本
- 更新通知协议文档
This commit is contained in:
ZL-Q
2026-04-28 17:20:17 +08:00
parent b9617ae152
commit a940f2ea47
16 changed files with 601 additions and 213 deletions
@@ -6,11 +6,15 @@ abstract class NotificationRepository {
Future<NotificationListResult> listNotifications({
int limit = 20,
String? cursor,
String locale = 'zh',
});
Future<int> getUnreadCount();
Future<NotificationItem> markRead({required String notificationId});
Future<NotificationItem> markRead({
required String notificationId,
String locale = 'zh',
});
Future<int> markAllRead();
}
@@ -25,8 +29,13 @@ class NotificationRepositoryImpl implements NotificationRepository {
Future<NotificationListResult> listNotifications({
int limit = 20,
String? cursor,
String locale = 'zh',
}) async {
return _notificationApi.listNotifications(limit: limit, cursor: cursor);
return _notificationApi.listNotifications(
limit: limit,
cursor: cursor,
locale: locale,
);
}
@override
@@ -35,8 +44,14 @@ class NotificationRepositoryImpl implements NotificationRepository {
}
@override
Future<NotificationItem> markRead({required String notificationId}) async {
return _notificationApi.markRead(notificationId: notificationId);
Future<NotificationItem> markRead({
required String notificationId,
String locale = 'zh',
}) async {
return _notificationApi.markRead(
notificationId: notificationId,
locale: locale,
);
}
@override