Initial commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
namespace PowderCoating.Application.Interfaces;
|
||||
|
||||
public interface IStorageMigrationService
|
||||
{
|
||||
Task<StorageMigrationResult> MigrateFilesystemToAzureAsync(
|
||||
string mediaBasePath,
|
||||
bool deleteLocalAfterMigration = false);
|
||||
}
|
||||
|
||||
public class StorageMigrationResult
|
||||
{
|
||||
public int Migrated { get; set; }
|
||||
public int Skipped { get; set; } // Already existed in Azure
|
||||
public int Failed { get; set; }
|
||||
public long BytesMigrated { get; set; }
|
||||
public List<MigratedFileEntry> Files { get; set; } = [];
|
||||
public List<string> Errors { get; set; } = [];
|
||||
public TimeSpan Duration { get; set; }
|
||||
|
||||
public bool HasErrors => Errors.Count > 0;
|
||||
public int Total => Migrated + Skipped + Failed;
|
||||
}
|
||||
|
||||
public class MigratedFileEntry
|
||||
{
|
||||
public string RelativePath { get; set; } = string.Empty;
|
||||
public string Container { get; set; } = string.Empty;
|
||||
public long FileSize { get; set; }
|
||||
public MigrationFileStatus Status { get; set; }
|
||||
}
|
||||
|
||||
public enum MigrationFileStatus
|
||||
{
|
||||
Migrated,
|
||||
Skipped,
|
||||
Failed
|
||||
}
|
||||
Reference in New Issue
Block a user