mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-24 06:04:59 +03:00
Adjust Clash API (#10088)
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
namespace ServiceLib.Models.Dto;
|
||||
|
||||
public record ClashItem
|
||||
{
|
||||
public Dictionary<string, ClashProxy> Proxies { get; init; } = [];
|
||||
public Dictionary<string, string> ProviderIndexMap { get; init; } = [];
|
||||
|
||||
public bool IsEmpty() => Proxies.Count == 0;
|
||||
}
|
||||
|
||||
public record ClashProxy
|
||||
{
|
||||
public List<string>? all { get; init; }
|
||||
public List<HistoryItem>? history { get; init; }
|
||||
public string? name { get; init; }
|
||||
public string? type { get; init; }
|
||||
public bool udp { get; init; }
|
||||
public string? now { get; init; }
|
||||
public int delay { get; init; }
|
||||
|
||||
public record HistoryItem
|
||||
{
|
||||
public string? time { get; init; }
|
||||
public int delay { get; init; }
|
||||
}
|
||||
}
|
||||
|
||||
public record ClashProvider
|
||||
{
|
||||
public string? name { get; init; }
|
||||
public List<ClashProxy>? proxies { get; init; }
|
||||
public string? type { get; init; }
|
||||
public string? vehicleType { get; init; }
|
||||
}
|
||||
|
||||
public record ClashProxies
|
||||
{
|
||||
public Dictionary<string, ClashProxy> proxies { get; init; } = [];
|
||||
}
|
||||
|
||||
public record ClashProviders
|
||||
{
|
||||
public Dictionary<string, ClashProvider> providers { get; init; } = [];
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using static ServiceLib.Models.Dto.ClashProxies;
|
||||
|
||||
namespace ServiceLib.Models.Dto;
|
||||
|
||||
public class ClashProviders
|
||||
{
|
||||
public Dictionary<string, ProvidersItem>? providers { get; set; }
|
||||
|
||||
public class ProvidersItem
|
||||
{
|
||||
public string? name { get; set; }
|
||||
public List<ProxiesItem>? proxies { get; set; }
|
||||
public string? type { get; set; }
|
||||
public string? vehicleType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
namespace ServiceLib.Models.Dto;
|
||||
|
||||
public class ClashProxies
|
||||
{
|
||||
public Dictionary<string, ProxiesItem>? proxies { get; set; }
|
||||
|
||||
public class ProxiesItem
|
||||
{
|
||||
public List<string>? all { get; set; }
|
||||
public List<HistoryItem>? history { get; set; }
|
||||
public string? name { get; set; }
|
||||
public string? type { get; set; }
|
||||
public bool udp { get; set; }
|
||||
public string? now { get; set; }
|
||||
public int delay { get; set; }
|
||||
}
|
||||
|
||||
public class HistoryItem
|
||||
{
|
||||
public string? time { get; set; }
|
||||
public int delay { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,9 @@ namespace ServiceLib.Models.Dto;
|
||||
[Serializable]
|
||||
public partial class ClashProxyModel : ReactiveObject
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public required string Name { get; set; }
|
||||
|
||||
public string? Type { get; set; }
|
||||
public required string Type { get; set; }
|
||||
|
||||
public string? Now { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user