feat: add aliyun oss storage foundation

This commit is contained in:
xiong
2026-07-26 14:43:04 +08:00
parent 47613b51bd
commit c6051f95f2
13 changed files with 969 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
namespace Tiku.Infrastructure.Storage;
public sealed class AliyunOssOptions
{
public const string SectionName = "Storage:AliyunOss";
public string? Region { get; set; }
public string? Endpoint { get; set; }
public string? AccessKeyId { get; set; }
public string? AccessKeySecret { get; set; }
public string? SecurityToken { get; set; }
public bool UseInternalEndpoint { get; set; }
public bool UsePathStyle { get; set; }
public bool UseCName { get; set; }
public int PresignDefaultMinutes { get; set; } = 15;
public bool IsConfigured =>
(!string.IsNullOrWhiteSpace(Region) || !string.IsNullOrWhiteSpace(Endpoint)) &&
!string.IsNullOrWhiteSpace(AccessKeyId) &&
!string.IsNullOrWhiteSpace(AccessKeySecret);
public static bool BeValid(AliyunOssOptions options)
{
return options.PresignDefaultMinutes > 0;
}
}