Added Nextcloud base

This commit is contained in:
2023-02-20 10:56:51 +01:00
parent e54ae9c2ff
commit fea36b9a6d
63 changed files with 1863 additions and 700 deletions

View File

@ -0,0 +1,26 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:http/src/response.dart';
import 'package:marianum_mobile/api/marianumcloud/talk/chat/getChatResponse.dart';
import 'package:marianum_mobile/api/marianumcloud/talk/talkApi.dart';
import 'getChatParams.dart';
class GetChat extends TalkApi<GetChatResponse> {
String chatToken;
GetChatParams params;
GetChat(this.chatToken, this.params) : super("v1/chat/$chatToken", null, getParameters: params.toJson());
@override
assemble(String raw) {
return GetChatResponse.fromJson(jsonDecode(raw)['ocs']); // TODO move "ocs" to superclass
}
@override
Future<Response> request(Uri uri, Object? body, Map<String, String>? headers) {
return http.get(uri, headers: headers);
}
}