Client/lib/api/mhsl/message/getMessages/getMessagesCache.dart

18 lines
522 B
Dart

import 'dart:convert';
import '../../../requestCache.dart';
import 'getMessages.dart';
import 'getMessagesResponse.dart';
class GetMessagesCache extends RequestCache<GetMessagesResponse> {
GetMessagesCache({onUpdate, renew}) : super(RequestCache.cacheMinute, onUpdate, renew: renew) {
start('MarianumMobile', 'message');
}
@override
GetMessagesResponse onLocalData(String json) => GetMessagesResponse.fromJson(jsonDecode(json));
@override
Future<GetMessagesResponse> onLoad() => GetMessages().run();
}