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

21 lines
549 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) {
return GetMessagesResponse.fromJson(jsonDecode(json));
}
@override
Future<GetMessagesResponse> onLoad() {
return GetMessages().run();
}
}