55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
using System.ComponentModel.DataAnnotations;
|
||
|
||
namespace TakeoutSaaS.Module.Storage.Options;
|
||
|
||
/// <summary>
|
||
/// 腾讯云 COS 访问配置。
|
||
/// </summary>
|
||
public sealed class TencentCosOptions
|
||
{
|
||
/// <summary>
|
||
/// SecretId。
|
||
/// </summary>
|
||
[Required]
|
||
public string SecretId { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// SecretKey。
|
||
/// </summary>
|
||
[Required]
|
||
public string SecretKey { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 存储地域(如 ap-guangzhou)。
|
||
/// </summary>
|
||
[Required]
|
||
public string Region { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 存储桶名称(含 AppId,如 takeout-bucket-123456)。
|
||
/// </summary>
|
||
[Required]
|
||
public string Bucket { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// COS 自定义域名或 API Endpoint(可选),未配置则根据 Region 生成默认域名。
|
||
/// </summary>
|
||
public string? Endpoint { get; set; }
|
||
|
||
/// <summary>
|
||
/// CDN 域名(可选),用于生成加速访问地址。
|
||
/// </summary>
|
||
[Url]
|
||
public string? CdnBaseUrl { get; set; }
|
||
|
||
/// <summary>
|
||
/// 是否使用 HTTPS。
|
||
/// </summary>
|
||
public bool UseHttps { get; set; } = true;
|
||
|
||
/// <summary>
|
||
/// 是否强制使用 PathStyle 访问,COS 默认可使用虚拟主机形式。
|
||
/// </summary>
|
||
public bool ForcePathStyle { get; set; }
|
||
}
|