♻️ File organize system v2

This commit is contained in:
2026-01-10 14:34:53 +08:00
parent cb04e53b7e
commit 8177bda232
7 changed files with 139 additions and 22 deletions

View File

@@ -762,27 +762,6 @@ public class FileService(
await db.SaveChangesAsync();
return count;
}
public async Task<string> CreateFastUploadLinkAsync(SnCloudFile file)
{
if (file.PoolId is null) throw new InvalidOperationException("Pool ID is null");
var dest = await GetRemoteStorageConfig(file.PoolId.Value);
if (dest is null) throw new InvalidOperationException($"No remote storage configured for pool {file.PoolId}");
var client = CreateMinioClient(dest);
if (client is null)
throw new InvalidOperationException(
$"Failed to configure client for remote destination '{file.PoolId}'"
);
var url = await client.PresignedPutObjectAsync(
new PresignedPutObjectArgs()
.WithBucket(dest.Bucket)
.WithObject(file.Id)
.WithExpiry(60 * 60 * 24)
);
return url;
}
}
file class UpdatableCloudFile(SnCloudFile file)