Webdav and Cleanup
This commit is contained in:
parent
09003439a6
commit
88e5a605fb
@ -16,14 +16,11 @@ class GetRoom extends TalkApi<GetRoomResponse> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
GetRoomResponse assemble(String raw) {
|
GetRoomResponse assemble(String raw) {
|
||||||
log("ASSEMBLING");
|
|
||||||
log(raw);
|
|
||||||
return GetRoomResponse.fromJson(jsonDecode(raw)['ocs']);
|
return GetRoomResponse.fromJson(jsonDecode(raw)['ocs']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<http.Response> request(Uri uri, Object? body, Map<String, String>? headers) {
|
Future<http.Response> request(Uri uri, Object? body, Map<String, String>? headers) {
|
||||||
log("REQUSTING...");
|
|
||||||
log(uri.toString());
|
log(uri.toString());
|
||||||
log(headers.toString());
|
log(headers.toString());
|
||||||
return http.get(uri, headers: headers);
|
return http.get(uri, headers: headers);
|
||||||
|
@ -14,13 +14,11 @@ class GetRoomCache extends RequestCache<GetRoomResponse> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
GetRoomResponse onLocalData(String json) {
|
GetRoomResponse onLocalData(String json) {
|
||||||
log("LOCAL DATA FOUND");
|
|
||||||
return GetRoomResponse.fromJson(jsonDecode(json));
|
return GetRoomResponse.fromJson(jsonDecode(json));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<GetRoomResponse> onLoad() {
|
Future<GetRoomResponse> onLoad() {
|
||||||
log("FETCHING DATA");
|
|
||||||
return GetRoom(
|
return GetRoom(
|
||||||
GetRoomParams(
|
GetRoomParams(
|
||||||
includeStatus: true,
|
includeStatus: true,
|
||||||
|
@ -1,9 +1,43 @@
|
|||||||
import 'package:marianum_mobile/api/apiRequest.dart';
|
// import 'dart:developer';
|
||||||
|
//
|
||||||
class WebdavApi extends ApiRequest {
|
// import 'package:marianum_mobile/api/apiParams.dart';
|
||||||
String basePath;
|
// import 'package:marianum_mobile/api/apiRequest.dart';
|
||||||
|
// import 'package:marianum_mobile/api/webuntis/queries/authenticate/authenticate.dart';
|
||||||
WebdavApi(this.basePath);
|
// import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
// import 'package:webdav_client/webdav_client.dart';
|
||||||
|
//
|
||||||
}
|
// import '../../apiResponse.dart';
|
||||||
|
//
|
||||||
|
// abstract class WebdavApi<T> extends ApiRequest {
|
||||||
|
// T genericParams;
|
||||||
|
//
|
||||||
|
// WebdavApi(this.genericParams) {
|
||||||
|
// establishWebdavConnection();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Future<ApiResponse> run();
|
||||||
|
//
|
||||||
|
// static Future<Client> webdav = establishWebdavConnection();
|
||||||
|
//
|
||||||
|
// static Future<Client> establishWebdavConnection() async {
|
||||||
|
// SharedPreferences preferences = await SharedPreferences.getInstance();
|
||||||
|
//
|
||||||
|
// // Client client = newClient(
|
||||||
|
// // "https://cloud.marianum-fulda.de/remote.php/dav/files/***REMOVED***/",
|
||||||
|
// // user: "***REMOVED***",
|
||||||
|
// // password: "***REMOVED***",
|
||||||
|
// // debug: true
|
||||||
|
// // );
|
||||||
|
// //
|
||||||
|
// // client.setHeaders(
|
||||||
|
// // {
|
||||||
|
// // "Authorization": "Bearer",
|
||||||
|
// // "User-Agent": "Marianum Fulda/Alpha0.1 (Development build) ; https://mhsl.eu/id.html",
|
||||||
|
// // }
|
||||||
|
// // );
|
||||||
|
//
|
||||||
|
// throw UnimplementedError();
|
||||||
|
// //return client;
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
Loading…
x
Reference in New Issue
Block a user