feat: 实现日历提醒完整功能(操作执行、通知服务重构、归档)
- 新增 ReminderActionExecutor 处理取消/稍后提醒操作 - 新增 ReminderOutboxStore 本地存储待处理操作 - 重构 LocalNotificationService 支持聚合提醒和交互操作 - 新增 event_color_resolver 工具类统一颜色解析 - 新增 CalendarService.archiveEvent 归档方法 - 增强 ModelTracking 支持缓存命中、推理token和成本追踪 - 添加 qwen3.5-35b-a3b 模型配置 - 更新 AndroidManifest 全屏intent权限 - 补充相关单元测试和文档
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
import '../../features/auth/presentation/bloc/auth_state.dart';
|
||||
import '../../features/calendar/data/services/calendar_service.dart';
|
||||
import '../../features/calendar/reminders/reminder_action_executor.dart';
|
||||
import '../notifications/local_notification_service.dart';
|
||||
|
||||
class AuthSessionBootstrapper {
|
||||
AuthSessionBootstrapper({
|
||||
required CalendarService calendarService,
|
||||
required LocalNotificationService notificationService,
|
||||
required ReminderActionExecutor reminderActionExecutor,
|
||||
}) : _calendarService = calendarService,
|
||||
_notificationService = notificationService;
|
||||
_notificationService = notificationService,
|
||||
_reminderActionExecutor = reminderActionExecutor;
|
||||
|
||||
final CalendarService _calendarService;
|
||||
final LocalNotificationService _notificationService;
|
||||
final ReminderActionExecutor _reminderActionExecutor;
|
||||
|
||||
String? _syncedUserId;
|
||||
|
||||
@@ -24,13 +28,15 @@ class AuthSessionBootstrapper {
|
||||
return;
|
||||
}
|
||||
|
||||
_syncedUserId = state.user.id;
|
||||
|
||||
try {
|
||||
await _reminderActionExecutor.replayPendingActions();
|
||||
|
||||
final now = DateTime.now();
|
||||
final start = now.subtract(const Duration(days: 90));
|
||||
final end = now.add(const Duration(days: 90));
|
||||
final events = await _calendarService.getEventsForRange(now, end);
|
||||
final events = await _calendarService.getEventsForRange(start, end);
|
||||
await _notificationService.rebuildUpcomingReminders(events);
|
||||
_syncedUserId = state.user.id;
|
||||
} catch (_) {
|
||||
// ignore reminder bootstrap failures
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user