You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

using System.Text.Json.Serialization;
namespace X1.DynamicClientCore.Models
{
/// <summary>
/// HTTP请求选项 - 定义HTTP请求的配置参数
/// </summary>
/// <remarks>
/// 包含超时、请求头、日志、熔断器等配置选项
/// </remarks>
public class RequestOptions
{
/// <summary>
/// 超时时间(秒)
/// </summary>
[JsonPropertyName("timeout")]
public int Timeout { get; set; } = 10;
/// <summary>
/// 请求头
/// </summary>
[JsonPropertyName("headers")]
public Dictionary<string, string> Headers { get; set; } = new()
{
["Accept"] = "application/json"
};
/// <summary>
/// 是否记录日志
/// </summary>
[JsonPropertyName("enableLogging")]
public bool EnableLogging { get; set; } = true;
/// <summary>
/// 是否启用熔断器
/// </summary>
[JsonPropertyName("enableCircuitBreaker")]
public bool EnableCircuitBreaker { get; set; } = true;
/// <summary>
/// 熔断器配置
/// </summary>
[JsonPropertyName("circuitBreaker")]
public CircuitBreakerOptions? CircuitBreaker { get; set; }
}
}