MCSI-8 refactor: rename variables for clarity in InstallationRepositoryImpl

This commit is contained in:
SquidSpirit 2025-07-12 18:31:36 +08:00
parent bacaef22c6
commit 94556a49d7

View File

@ -3,22 +3,22 @@ import 'package:minecraft_server_installer/main/adapter/gateway/installation_fil
import 'package:minecraft_server_installer/main/application/repository/installation_repository.dart'; import 'package:minecraft_server_installer/main/application/repository/installation_repository.dart';
class InstallationRepositoryImpl implements InstallationRepository { class InstallationRepositoryImpl implements InstallationRepository {
final InstallationApiService _apiService; final InstallationApiService _installationApiService;
final InstallationFileStorage _fileStorage; final InstallationFileStorage _installationFileStorage;
InstallationRepositoryImpl(this._apiService, this._fileStorage); InstallationRepositoryImpl(this._installationApiService, this._installationFileStorage);
@override @override
Future<void> downloadFile(Uri url, String path, {DownloadProgressCallback? onProgressChanged}) async { Future<void> downloadFile(Uri url, String path, {DownloadProgressCallback? onProgressChanged}) async {
final fileBytes = await _apiService.fetchRemoteFile(url, onProgressChanged: onProgressChanged); final fileBytes = await _installationApiService.fetchRemoteFile(url, onProgressChanged: onProgressChanged);
await _fileStorage.saveFile(fileBytes, path); await _installationFileStorage.saveFile(fileBytes, path);
} }
@override @override
Future<void> writeFile(String path, String content) => _fileStorage.writeFile(path, content); Future<void> writeFile(String path, String content) => _installationFileStorage.writeFile(path, content);
@override @override
Future<void> grantFileExecutePermission(String path) { Future<void> grantFileExecutePermission(String path) {
return _fileStorage.grantFileExecutePermission(path); return _installationFileStorage.grantFileExecutePermission(path);
} }
} }