Files
TakeoutSaaS.TenantApi/src/Application/TakeoutSaaS.Application/Storage/Contracts/UploadFileRequest.cs

60 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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; }
}