using System.Collections.Generic; using System.IO; namespace TakeoutSaaS.Module.Storage.Models; /// /// 对象存储上传请求参数。 /// /// /// 初始化上传请求。 /// /// 对象键(含路径)。 /// 文件流。 /// 内容类型。 /// 内容长度。 /// 是否返回签名访问链接。 /// 签名有效期。 /// 附加元数据。 public sealed class StorageUploadRequest( string objectKey, Stream content, string contentType, long contentLength, bool generateSignedUrl, TimeSpan signedUrlExpires, IDictionary? metadata = null) { /// /// 对象键。 /// public string ObjectKey { get; } = objectKey; /// /// 文件流。 /// public Stream Content { get; } = content; /// /// 内容类型。 /// public string ContentType { get; } = contentType; /// /// 内容长度。 /// public long ContentLength { get; } = contentLength; /// /// 是否需要签名访问链接。 /// public bool GenerateSignedUrl { get; } = generateSignedUrl; /// /// 签名有效期。 /// public TimeSpan SignedUrlExpires { get; } = signedUrlExpires; /// /// 元数据集合。 /// public IReadOnlyDictionary Metadata { get; } = metadata == null ? new Dictionary() : new Dictionary(metadata); }