forked from gongxuegit/tiku-backend.net
feat: add aliyun oss storage foundation
This commit is contained in:
26
Tiku.Infrastructure/Storage/AliyunOssOptions.cs
Normal file
26
Tiku.Infrastructure/Storage/AliyunOssOptions.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user