refactor: 重构提醒通知系统

This commit is contained in:
zl-q
2026-04-01 00:42:34 +08:00
parent 9a231dae9e
commit 6722f3d74b
21 changed files with 375 additions and 171 deletions
@@ -50,14 +50,21 @@ class CalendarService {
return events;
}
Future<ScheduleItemModel> getEventById(String id) async {
Future<ScheduleItemModel> getEventById(
String id, {
bool reconcileReminder = true,
}) async {
final response = await _apiClient.get<Map<String, dynamic>>('$_prefix/$id');
final data = response.data;
if (data == null) {
throw StateError('Invalid getEventById response: empty payload');
}
final event = ScheduleItemModel.fromJson(data);
await _reminderReconcileService?.reconcileEvent(_toReminderSnapshot(event));
if (reconcileReminder) {
await _reminderReconcileService?.reconcileEvent(
_toReminderSnapshot(event),
);
}
return event;
}