- GwRouteMatch: 路由匹配配置值对象(Path, Methods, Hosts, Headers, QueryParameters) - GwRouteHeader: Header 匹配规则值对象 - GwRouteQueryParameter: 查询参数匹配规则值对象 - GwLoadBalancingPolicy: 负载均衡策略枚举 - GwTransform: 请求/响应转换规则值对象 - EF Core 使用 ToJson() 将值对象映射为 JSON 列
79 lines
2.0 KiB
C#
79 lines
2.0 KiB
C#
namespace Fengling.Platform.Domain.AggregatesModel.GatewayAggregate;
|
||
|
||
/// <summary>
|
||
/// 网关集群聚合根 - 表示后端服务集群配置
|
||
/// </summary>
|
||
public class GwCluster
|
||
{
|
||
public string Id { get; set; } = Guid.CreateVersion7().ToString("N");
|
||
|
||
/// <summary>
|
||
/// 集群业务标识
|
||
/// </summary>
|
||
public string ClusterId { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 集群名称
|
||
/// </summary>
|
||
public string Name { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 描述
|
||
/// </summary>
|
||
public string? Description { get; set; }
|
||
|
||
/// <summary>
|
||
/// 目标端点列表(内嵌)
|
||
/// </summary>
|
||
public List<GwDestination> Destinations { get; set; } = [];
|
||
|
||
/// <summary>
|
||
/// 负载均衡策略
|
||
/// </summary>
|
||
public GwLoadBalancingPolicy LoadBalancingPolicy { get; set; } = GwLoadBalancingPolicy.RoundRobin;
|
||
|
||
/// <summary>
|
||
/// 健康检查配置(JSON 列存储)
|
||
/// </summary>
|
||
public GwHealthCheckConfig? HealthCheck { get; set; }
|
||
|
||
/// <summary>
|
||
/// 会话亲和配置(JSON 列存储)
|
||
/// </summary>
|
||
public GwSessionAffinityConfig? SessionAffinity { get; set; }
|
||
|
||
/// <summary>
|
||
/// 状态
|
||
/// </summary>
|
||
public int Status { get; set; } = 1;
|
||
|
||
/// <summary>
|
||
/// 创建人ID
|
||
/// </summary>
|
||
public long? CreatedBy { get; set; }
|
||
|
||
/// <summary>
|
||
/// 创建时间
|
||
/// </summary>
|
||
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
|
||
|
||
/// <summary>
|
||
/// 更新人ID
|
||
/// </summary>
|
||
public long? UpdatedBy { get; set; }
|
||
|
||
/// <summary>
|
||
/// 更新时间
|
||
/// </summary>
|
||
public DateTime? UpdatedTime { get; set; }
|
||
|
||
/// <summary>
|
||
/// 是否删除
|
||
/// </summary>
|
||
public bool IsDeleted { get; set; } = false;
|
||
|
||
/// <summary>
|
||
/// 版本号,用于乐观并发
|
||
/// </summary>
|
||
public int Version { get; set; } = 0;
|
||
} |