feat: 初始化 Gateway 仓库

This commit is contained in:
root
2026-01-29 05:25:02 +00:00
commit 2b6402058d
10 changed files with 437 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
namespace TakeoutSaaS.ApiGateway.Configuration;
/// <summary>
/// 网关 OpenTelemetry 导出配置。
/// </summary>
public class GatewayOpenTelemetryOptions
{
/// <summary>
/// 是否启用 OpenTelemetry。
/// </summary>
public bool Enabled { get; set; } = true;
/// <summary>
/// 服务名称,用于 Resource 标识。
/// </summary>
public string ServiceName { get; set; } = "TakeoutSaaS.ApiGateway";
/// <summary>
/// OTLP 导出端点http/https
/// </summary>
public string? OtlpEndpoint { get; set; }
}

View File

@@ -0,0 +1,27 @@
namespace TakeoutSaaS.ApiGateway.Configuration;
/// <summary>
/// 网关限流参数配置。
/// </summary>
public class GatewayRateLimitOptions
{
/// <summary>
/// 是否开启固定窗口限流。
/// </summary>
public bool Enabled { get; set; } = true;
/// <summary>
/// 固定窗口内允许的最大请求数。
/// </summary>
public int PermitLimit { get; set; } = 300;
/// <summary>
/// 固定窗口长度(秒)。
/// </summary>
public int WindowSeconds { get; set; } = 60;
/// <summary>
/// 排队等待的最大请求数。
/// </summary>
public int QueueLimit { get; set; } = 100;
}