60 lines
1.3 KiB
C#
60 lines
1.3 KiB
C#
using System.IO;
|
||
using TakeoutSaaS.Application.Storage.Enums;
|
||
|
||
namespace TakeoutSaaS.Application.Storage.Contracts;
|
||
|
||
/// <summary>
|
||
/// 上传文件请求模型。
|
||
/// </summary>
|
||
public sealed class UploadFileRequest
|
||
{
|
||
/// <summary>
|
||
/// 创建上传文件请求。
|
||
/// </summary>
|
||
public UploadFileRequest(
|
||
UploadFileType fileType,
|
||
Stream content,
|
||
string fileName,
|
||
string contentType,
|
||
long contentLength,
|
||
string? requestOrigin)
|
||
{
|
||
FileType = fileType;
|
||
Content = content;
|
||
FileName = fileName;
|
||
ContentType = contentType;
|
||
ContentLength = contentLength;
|
||
RequestOrigin = requestOrigin;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 文件分类。
|
||
/// </summary>
|
||
public UploadFileType FileType { get; }
|
||
|
||
/// <summary>
|
||
/// 文件流。
|
||
/// </summary>
|
||
public Stream Content { get; }
|
||
|
||
/// <summary>
|
||
/// 原始文件名。
|
||
/// </summary>
|
||
public string FileName { get; }
|
||
|
||
/// <summary>
|
||
/// 内容类型。
|
||
/// </summary>
|
||
public string ContentType { get; }
|
||
|
||
/// <summary>
|
||
/// 文件大小。
|
||
/// </summary>
|
||
public long ContentLength { get; }
|
||
|
||
/// <summary>
|
||
/// 请求来源(Origin/Referer)。
|
||
/// </summary>
|
||
public string? RequestOrigin { get; }
|
||
}
|