- 配置AuthService使用OpenIddict reference tokens - 添加fengling-api客户端用于introspection验证 - 配置Console API通过OpenIddict验证reference tokens - 实现Tenant/Users/Roles/OAuthClients CRUD API - 添加GatewayController服务注册API - 重构Repository和Service层支持多租户 BREAKING CHANGE: API认证现在使用OpenIddict reference tokens
90 lines
2.8 KiB
C#
90 lines
2.8 KiB
C#
namespace Fengling.Console.Models.Dtos;
|
|
|
|
public class GatewayServiceDto
|
|
{
|
|
public long Id { get; set; }
|
|
public string ServicePrefix { get; set; } = "";
|
|
public string ServiceName { get; set; } = "";
|
|
public string Version { get; set; } = "v1";
|
|
public string ClusterId { get; set; } = "";
|
|
public string PathPattern { get; set; } = "";
|
|
public string ServiceAddress { get; set; } = "";
|
|
public string DestinationId { get; set; } = "";
|
|
public int Weight { get; set; } = 1;
|
|
public int InstanceCount { get; set; }
|
|
public bool IsGlobal { get; set; }
|
|
public string? TenantCode { get; set; }
|
|
public int Status { get; set; } = 1;
|
|
public DateTime CreatedAt { get; set; }
|
|
}
|
|
|
|
public class CreateGatewayServiceDto
|
|
{
|
|
public string ServicePrefix { get; set; } = "";
|
|
public string ServiceName { get; set; } = "";
|
|
public string Version { get; set; } = "v1";
|
|
public string ServiceAddress { get; set; } = "";
|
|
public string DestinationId { get; set; } = "";
|
|
public int Weight { get; set; } = 1;
|
|
public bool IsGlobal { get; set; } = true;
|
|
public string? TenantCode { get; set; }
|
|
}
|
|
|
|
public class GatewayRouteDto
|
|
{
|
|
public long Id { get; set; }
|
|
public string ServiceName { get; set; } = "";
|
|
public string ClusterId { get; set; } = "";
|
|
public string PathPattern { get; set; } = "";
|
|
public int Priority { get; set; }
|
|
public bool IsGlobal { get; set; }
|
|
public string? TenantCode { get; set; }
|
|
public int Status { get; set; }
|
|
public int InstanceCount { get; set; }
|
|
}
|
|
|
|
public class CreateGatewayRouteDto
|
|
{
|
|
public string ServiceName { get; set; } = "";
|
|
public string ClusterId { get; set; } = "";
|
|
public string PathPattern { get; set; } = "";
|
|
public int Priority { get; set; } = 10;
|
|
public bool IsGlobal { get; set; } = true;
|
|
public string? TenantCode { get; set; }
|
|
}
|
|
|
|
public class GatewayInstanceDto
|
|
{
|
|
public long Id { get; set; }
|
|
public string ClusterId { get; set; } = "";
|
|
public string DestinationId { get; set; } = "";
|
|
public string Address { get; set; } = "";
|
|
public int Weight { get; set; } = 1;
|
|
public int Health { get; set; } = 1;
|
|
public int Status { get; set; } = 1;
|
|
public DateTime CreatedAt { get; set; }
|
|
}
|
|
|
|
public class CreateGatewayInstanceDto
|
|
{
|
|
public string ClusterId { get; set; } = "";
|
|
public string DestinationId { get; set; } = "";
|
|
public string Address { get; set; } = "";
|
|
public int Weight { get; set; } = 1;
|
|
}
|
|
|
|
public class GatewayStatisticsDto
|
|
{
|
|
public int TotalServices { get; set; }
|
|
public int GlobalRoutes { get; set; }
|
|
public int TenantRoutes { get; set; }
|
|
public int TotalInstances { get; set; }
|
|
public int HealthyInstances { get; set; }
|
|
public List<GatewayServiceDto> RecentServices { get; set; } = new();
|
|
}
|
|
|
|
public class GatewayUpdateWeightDto
|
|
{
|
|
public int Weight { get; set; }
|
|
}
|