Improved models

This commit is contained in:
2dust
2024-10-08 09:50:03 +08:00
parent f60575b77c
commit 3e74bb65bd
17 changed files with 176 additions and 344 deletions

View File

@@ -2,16 +2,16 @@
{
public class ClashConnectionModel
{
public string id { get; set; }
public string network { get; set; }
public string type { get; set; }
public string host { get; set; }
public string? id { get; set; }
public string? network { get; set; }
public string? type { get; set; }
public string? host { get; set; }
public ulong upload { get; set; }
public ulong download { get; set; }
public string uploadTraffic { get; set; }
public string downloadTraffic { get; set; }
public string? uploadTraffic { get; set; }
public string? downloadTraffic { get; set; }
public double time { get; set; }
public string elapsed { get; set; }
public string chain { get; set; }
public string? elapsed { get; set; }
public string? chain { get; set; }
}
}

View File

@@ -9,29 +9,29 @@
public class ConnectionItem
{
public string id { get; set; } = string.Empty;
public MetadataItem metadata { get; set; }
public string? id { get; set; }
public MetadataItem? metadata { get; set; }
public ulong upload { get; set; }
public ulong download { get; set; }
public DateTime start { get; set; }
public List<string>? chains { get; set; }
public string rule { get; set; }
public string rulePayload { get; set; }
public string? rule { get; set; }
public string? rulePayload { get; set; }
}
public class MetadataItem
{
public string network { get; set; }
public string type { get; set; }
public string sourceIP { get; set; }
public string destinationIP { get; set; }
public string sourcePort { get; set; }
public string destinationPort { get; set; }
public string host { get; set; }
public string nsMode { get; set; }
public string? network { get; set; }
public string? type { get; set; }
public string? sourceIP { get; set; }
public string? destinationIP { get; set; }
public string? sourcePort { get; set; }
public string? destinationPort { get; set; }
public string? host { get; set; }
public string? nsMode { get; set; }
public object uid { get; set; }
public string process { get; set; }
public string processPath { get; set; }
public string remoteDestination { get; set; }
public string? process { get; set; }
public string? processPath { get; set; }
public string? remoteDestination { get; set; }
}
}

View File

@@ -4,14 +4,14 @@ namespace ServiceLib.Models
{
public class ClashProviders
{
public Dictionary<String, ProvidersItem> providers { get; set; }
public Dictionary<string, ProvidersItem>? providers { get; set; }
public class ProvidersItem
{
public string name { get; set; }
public ProxiesItem[] proxies { get; set; }
public string type { get; set; }
public string vehicleType { get; set; }
public string? name { get; set; }
public List<ProxiesItem>? proxies { get; set; }
public string? type { get; set; }
public string? vehicleType { get; set; }
}
}
}

View File

@@ -2,22 +2,22 @@
{
public class ClashProxies
{
public Dictionary<String, ProxiesItem> proxies { get; set; }
public Dictionary<string, ProxiesItem>? proxies { get; set; }
public class ProxiesItem
{
public string[] all { get; set; }
public List<HistoryItem> history { get; set; }
public string name { get; set; }
public string type { get; set; }
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 string? now { get; set; }
public int delay { get; set; }
}
public class HistoryItem
{
public string time { get; set; }
public string? time { get; set; }
public int delay { get; set; }
}
}

View File

@@ -3,15 +3,15 @@
[Serializable]
public class ClashProxyModel
{
public string name { get; set; }
public string? name { get; set; }
public string type { get; set; }
public string? type { get; set; }
public string now { get; set; }
public string? now { get; set; }
public int delay { get; set; }
public string delayName { get; set; }
public string? delayName { get; set; }
public bool isActive { get; set; }
}

View File

@@ -2,12 +2,12 @@
{
public class ComboItem
{
public string ID
public string? ID
{
get; set;
}
public string Text
public string? Text
{
get; set;
}

View File

@@ -10,8 +10,6 @@
public string indexId { get; set; }
public string subIndexId { get; set; }
public string systemProxyExceptions { get; set; }
public string systemProxyAdvancedProtocol { get; set; }
public ECoreType runningCoreType { get; set; }

View File

@@ -4,19 +4,19 @@ namespace ServiceLib.Models
{
public class GitHubReleaseAsset
{
[JsonPropertyName("url")] public string Url { get; set; }
[JsonPropertyName("url")] public string? Url { get; set; }
[JsonPropertyName("id")] public int Id { get; set; }
[JsonPropertyName("node_id")] public string NodeId { get; set; }
[JsonPropertyName("node_id")] public string? NodeId { get; set; }
[JsonPropertyName("name")] public string Name { get; set; }
[JsonPropertyName("name")] public string? Name { get; set; }
[JsonPropertyName("label")] public object Label { get; set; }
[JsonPropertyName("content_type")] public string ContentType { get; set; }
[JsonPropertyName("content_type")] public string? ContentType { get; set; }
[JsonPropertyName("state")] public string State { get; set; }
[JsonPropertyName("state")] public string? State { get; set; }
[JsonPropertyName("size")] public int Size { get; set; }
@@ -26,28 +26,28 @@ namespace ServiceLib.Models
[JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; }
[JsonPropertyName("browser_download_url")] public string BrowserDownloadUrl { get; set; }
[JsonPropertyName("browser_download_url")] public string? BrowserDownloadUrl { get; set; }
}
public class GitHubRelease
{
[JsonPropertyName("url")] public string Url { get; set; }
[JsonPropertyName("url")] public string? Url { get; set; }
[JsonPropertyName("assets_url")] public string AssetsUrl { get; set; }
[JsonPropertyName("assets_url")] public string? AssetsUrl { get; set; }
[JsonPropertyName("upload_url")] public string UploadUrl { get; set; }
[JsonPropertyName("upload_url")] public string? UploadUrl { get; set; }
[JsonPropertyName("html_url")] public string HtmlUrl { get; set; }
[JsonPropertyName("html_url")] public string? HtmlUrl { get; set; }
[JsonPropertyName("id")] public int Id { get; set; }
[JsonPropertyName("node_id")] public string NodeId { get; set; }
[JsonPropertyName("node_id")] public string? NodeId { get; set; }
[JsonPropertyName("tag_name")] public string TagName { get; set; }
[JsonPropertyName("tag_name")] public string? TagName { get; set; }
[JsonPropertyName("target_commitish")] public string TargetCommitish { get; set; }
[JsonPropertyName("target_commitish")] public string? TargetCommitish { get; set; }
[JsonPropertyName("name")] public string Name { get; set; }
[JsonPropertyName("name")] public string? Name { get; set; }
[JsonPropertyName("draft")] public bool Draft { get; set; }
@@ -59,10 +59,10 @@ namespace ServiceLib.Models
[JsonPropertyName("assets")] public List<GitHubReleaseAsset> Assets { get; set; }
[JsonPropertyName("tarball_url")] public string TarballUrl { get; set; }
[JsonPropertyName("tarball_url")] public string? TarballUrl { get; set; }
[JsonPropertyName("zipball_url")] public string ZipballUrl { get; set; }
[JsonPropertyName("zipball_url")] public string? ZipballUrl { get; set; }
[JsonPropertyName("body")] public string Body { get; set; }
[JsonPropertyName("body")] public string? Body { get; set; }
}
}

View File

@@ -3,11 +3,11 @@
[Serializable]
public class ServerTestItem
{
public string indexId { get; set; }
public string address { get; set; }
public int port { get; set; }
public EConfigType configType { get; set; }
public bool allowTest { get; set; }
public int delay { get; set; }
public string? IndexId { get; set; }
public string? Address { get; set; }
public int Port { get; set; }
public EConfigType ConfigType { get; set; }
public bool AllowTest { get; set; }
public int Delay { get; set; }
}
}

View File

@@ -2,17 +2,17 @@
{
public class SsSIP008
{
public List<SsServer> servers { get; set; }
public List<SsServer>? servers { get; set; }
}
[Serializable]
public class SsServer
{
public string remarks { get; set; }
public string server { get; set; }
public string server_port { get; set; }
public string method { get; set; }
public string password { get; set; }
public string plugin { get; set; }
public string? remarks { get; set; }
public string? server { get; set; }
public string? server_port { get; set; }
public string? method { get; set; }
public string? password { get; set; }
public string? plugin { get; set; }
}
}

View File

@@ -1,20 +0,0 @@
namespace ServiceLib.Models
{
public class SysProxyConfig
{
public bool UserSettingsRecorded;
public string Flags;
public string ProxyServer;
public string BypassList;
public string PacUrl;
public SysProxyConfig()
{
UserSettingsRecorded = false;
Flags = "1";
ProxyServer = "";
BypassList = "";
PacUrl = "";
}
}
}