fbmobile/lib/core/services/file_service.dart

34 lines
1,000 B
Dart
Raw Normal View History

2021-02-02 14:33:23 +00:00
import 'dart:async';
import 'dart:io';
import '../../core/repositories/file_repository.dart';
import '../../locator.dart';
import '../models/rest/config.dart';
import '../models/rest/history.dart';
import '../models/rest/uploaded_multi_response.dart';
import '../models/rest/uploaded_response.dart';
2021-02-02 14:33:23 +00:00
class FileService {
final FileRepository _fileRepository = locator<FileRepository>();
Future<Config> getConfig(String url) async {
2021-02-02 14:33:23 +00:00
return await _fileRepository.getConfig(url);
}
Future<History> getHistory() async {
2021-02-02 14:33:23 +00:00
return await _fileRepository.getHistory();
}
Future<void> deletePaste(String id) async {
return await _fileRepository.postDelete(id);
2021-02-02 14:33:23 +00:00
}
Future<UploadedResponse> uploadPaste(List<File> files, Map<String, String> additionalFiles) async {
return await _fileRepository.postUpload(files, additionalFiles);
2021-02-02 14:33:23 +00:00
}
Future<UploadedMultiResponse> uploadMultiPaste(List<String> ids) async {
return await _fileRepository.postCreateMultiPaste(ids);
2021-02-02 14:33:23 +00:00
}
}