DigitalFactory/Admin.NET/Admin.NET.Core/Option/UploadOptions.cs

51 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// 大名科技(天津)有限公司版权所有 电话18020030720 QQ515096995
//
// 此源代码遵循位于源代码树根目录中的 LICENSE 文件的许可证
using OnceMi.AspNetCore.OSS;
namespace Admin.NET.Core;
/// <summary>
/// 文件上传配置选项
/// </summary>
public sealed class UploadOptions : IConfigurableOptions
{
/// <summary>
/// 路径
/// </summary>
public string Path { get; set; }
/// <summary>
/// 大小
/// </summary>
public long MaxSize { get; set; }
/// <summary>
/// 上传格式
/// </summary>
public List<string> ContentType { get; set; }
/// <summary>
/// 启用文件MD5验证
/// </summary>
/// <remarks>防止重复上传</remarks>
public bool EnableMd5 { get; set; }
}
/// <summary>
/// 对象存储配置选项
/// </summary>
public sealed class OSSProviderOptions : OSSOptions, IConfigurableOptions
{
/// <summary>
/// 是否启用OSS存储
/// </summary>
public bool IsEnable { get; set; }
/// <summary>
/// 自定义桶名称 不能直接使用Provider来替代桶名称
/// 例:阿里云 1.只能包括小写字母,数字,短横线(-2.必须以小写字母或者数字开头 3.长度必须在3-63字节之间
/// </summary>
public string Bucket { get; set; }
}