Added Nextcloud base
This commit is contained in:
30
lib/api/marianumcloud/talk/room/getRoomCache.dart
Normal file
30
lib/api/marianumcloud/talk/room/getRoomCache.dart
Normal file
@ -0,0 +1,30 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:marianum_mobile/api/marianumcloud/talk/room/getRoomParams.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/talk/room/getRoomResponse.dart';
|
||||
import 'package:marianum_mobile/api/requestCache.dart';
|
||||
|
||||
import 'getRoom.dart';
|
||||
|
||||
class GetRoomCache extends RequestCache<GetRoomResponse> {
|
||||
GetRoomCache({onUpdate}) : super(RequestCache.cacheMinute, onUpdate) {
|
||||
start("MarianumMobile", "nc-rooms");
|
||||
}
|
||||
|
||||
@override
|
||||
GetRoomResponse onLocalData(String json) {
|
||||
log("LOCAL DATA FOUND");
|
||||
return GetRoomResponse.fromJson(jsonDecode(json));
|
||||
}
|
||||
|
||||
@override
|
||||
Future<GetRoomResponse> onLoad() {
|
||||
log("FETCHING DATA");
|
||||
return GetRoom(
|
||||
GetRoomParams(
|
||||
includeStatus: true,
|
||||
)
|
||||
).run();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user