Added api for custom timetable events

This commit is contained in:
2024-02-12 01:00:12 +01:00
parent 3eae5ba10a
commit 22db412e75
36 changed files with 849 additions and 229 deletions

View File

@ -0,0 +1,24 @@
import 'dart:convert';
import '../../../requestCache.dart';
import 'getCustomTimetableEvent.dart';
import 'getCustomTimetableEventParams.dart';
import 'getCustomTimetableEventResponse.dart';
class GetCustomTimetableEventCache extends RequestCache<GetCustomTimetableEventResponse> {
GetCustomTimetableEventParams params;
GetCustomTimetableEventCache(this.params, {onUpdate, renew}) : super(RequestCache.cacheMinute, onUpdate, renew: renew) {
start("MarianumMobile", "customTimetableEvents");
}
@override
Future<GetCustomTimetableEventResponse> onLoad() {
return GetCustomTimetableEvent(params).run();
}
@override
GetCustomTimetableEventResponse onLocalData(String json) {
return GetCustomTimetableEventResponse.fromJson(jsonDecode(json));
}
}