59 lines
1.6 KiB
C#
59 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace IM.InitCommon
|
|
{
|
|
public class StorageOptions
|
|
{
|
|
public string DefaultProviderCode { get; set; }
|
|
public Dictionary<string, StorageProviderOptions> Providers { get; set; }
|
|
}
|
|
|
|
public class StorageProviderOptions
|
|
{
|
|
public string ProviderCode { get; init; } = default!;
|
|
|
|
public StorageProviderType ProviderType { get; init; }
|
|
|
|
public bool Enabled { get; init; } = true;
|
|
|
|
public string Bucket { get; init; } = default!;
|
|
|
|
public string Region { get; init; } = default!;
|
|
|
|
public string? Endpoint { get; init; }
|
|
|
|
public string? PublicBaseUrl { get; init; }
|
|
|
|
public string? AccessKeyId { get; init; }
|
|
|
|
public string? AccessKeySecret { get; init; }
|
|
|
|
public string? LocalRootPath { get; init; }
|
|
|
|
public string? LocalUploadApiBaseUrl { get; init; }
|
|
|
|
public TimeSpan UploadUrlExpiresIn { get; init; } = TimeSpan.FromMinutes(15);
|
|
|
|
public TimeSpan DownloadUrlExpiresIn { get; init; } = TimeSpan.FromMinutes(30);
|
|
|
|
public long MaxObjectSizeBytes { get; init; } = 1024L * 1024 * 1024;
|
|
|
|
public int MinPartSizeBytes { get; init; } = 5 * 1024 * 1024;
|
|
public int DefaultPartSizeBytes { get; init; } = 5 * 1024 * 1024;
|
|
|
|
public int MaxPartCount { get; init; } = 10_000;
|
|
}
|
|
public enum StorageProviderType
|
|
{
|
|
Local = 1,
|
|
AwsS3 = 2,
|
|
AliyunOss = 3,
|
|
TencentCos = 4,
|
|
Minio = 5
|
|
}
|
|
}
|