Files
TakeoutSaaS.TenantApi/src/Modules/TakeoutSaaS.Module.Storage/Options/TencentCosOptions.cs
2026-02-17 12:12:01 +08:00

55 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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; }
}