From 8090799ccc7c175cb04efe7e4960f38b74c19dad Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 11 May 2026 11:00:19 +0800 Subject: [PATCH] Refactor models into sub-namespaces Move many model classes into new sub-namespaces (ServiceLib.Models.CoreConfigs, ServiceLib.Models.Configs, ServiceLib.Models.Dto, ServiceLib.Models.Entities). Update GlobalUsings in ServiceLib, v2rayN.Desktop, v2rayN and add a tests GlobalUsings file to reference the new namespaces. Adjust static using directives in ClashApiManager and ClashProxiesViewModel to use ServiceLib.Models.Dto. This is a reorganization/rename of files and namespaces with no functional changes. --- v2rayN/ServiceLib.Tests/GlobalUsings.cs | 40 +++++++++++++++++++ v2rayN/ServiceLib/GlobalUsings.cs | 5 ++- v2rayN/ServiceLib/Manager/ClashApiManager.cs | 2 +- .../ServiceLib/Models/{ => Configs}/Config.cs | 2 +- .../Models/{ => Configs}/ConfigItems.cs | 2 +- .../{ => CoreConfigs}/CoreConfigContext.cs | 2 +- .../Models/{ => CoreConfigs}/CoreInfo.cs | 2 +- .../Models/{ => CoreConfigs}/SingboxConfig.cs | 2 +- .../Models/{ => CoreConfigs}/V2rayConfig.cs | 2 +- .../{ => CoreConfigs}/V2rayMetricsVars.cs | 2 +- .../{ => CoreConfigs}/V2rayTcpRequest.cs | 2 +- .../Models/{ => Dto}/CheckUpdateModel.cs | 2 +- .../Models/{ => Dto}/ClashConnectionModel.cs | 2 +- .../Models/{ => Dto}/ClashConnections.cs | 2 +- .../Models/{ => Dto}/ClashProviders.cs | 4 +- .../Models/{ => Dto}/ClashProxies.cs | 2 +- .../Models/{ => Dto}/ClashProxyModel.cs | 2 +- v2rayN/ServiceLib/Models/{ => Dto}/CmdItem.cs | 2 +- .../ServiceLib/Models/{ => Dto}/ComboItem.cs | 2 +- .../Models/{ => Dto}/GitHubRelease.cs | 2 +- .../ServiceLib/Models/{ => Dto}/IPAPIInfo.cs | 2 +- .../Models/{ => Dto}/ProfileItemModel.cs | 2 +- .../ServiceLib/Models/{ => Dto}/RetResult.cs | 2 +- .../Models/{ => Dto}/RoutingItemModel.cs | 2 +- .../Models/{ => Dto}/RoutingTemplate.cs | 2 +- .../Models/{ => Dto}/RulesItemModel.cs | 2 +- .../Models/{ => Dto}/SemanticVersion.cs | 2 +- .../Models/{ => Dto}/ServerSpeedItem.cs | 2 +- .../Models/{ => Dto}/ServerTestItem.cs | 2 +- .../Models/{ => Dto}/SpeedTestResult.cs | 2 +- .../ServiceLib/Models/{ => Dto}/SsSIP008.cs | 2 +- .../Models/{ => Dto}/UpdateResult.cs | 2 +- .../Models/{ => Dto}/VmessQRCode.cs | 2 +- .../Models/{ => Entities}/DNSItem.cs | 2 +- .../{ => Entities}/FullConfigTemplateItem.cs | 2 +- .../Models/{ => Entities}/ProfileExItem.cs | 2 +- .../Models/{ => Entities}/ProfileGroupItem.cs | 2 +- .../Models/{ => Entities}/ProfileItem.cs | 2 +- .../{ => Entities}/ProtocolExtraItem.cs | 2 +- .../Models/{ => Entities}/RoutingItem.cs | 2 +- .../Models/{ => Entities}/RulesItem.cs | 2 +- .../Models/{ => Entities}/ServerStatItem.cs | 2 +- .../Models/{ => Entities}/SubItem.cs | 2 +- .../{ => Entities}/TransportExtraItem.cs | 2 +- .../ViewModels/ClashProxiesViewModel.cs | 4 +- v2rayN/v2rayN.Desktop/GlobalUsings.cs | 5 ++- v2rayN/v2rayN/GlobalUsings.cs | 5 ++- 47 files changed, 97 insertions(+), 48 deletions(-) create mode 100644 v2rayN/ServiceLib.Tests/GlobalUsings.cs rename v2rayN/ServiceLib/Models/{ => Configs}/Config.cs (97%) rename v2rayN/ServiceLib/Models/{ => Configs}/ConfigItems.cs (99%) rename v2rayN/ServiceLib/Models/{ => CoreConfigs}/CoreConfigContext.cs (95%) rename v2rayN/ServiceLib/Models/{ => CoreConfigs}/CoreInfo.cs (95%) rename v2rayN/ServiceLib/Models/{ => CoreConfigs}/SingboxConfig.cs (99%) rename v2rayN/ServiceLib/Models/{ => CoreConfigs}/V2rayConfig.cs (99%) rename v2rayN/ServiceLib/Models/{ => CoreConfigs}/V2rayMetricsVars.cs (88%) rename v2rayN/ServiceLib/Models/{ => CoreConfigs}/V2rayTcpRequest.cs (85%) rename v2rayN/ServiceLib/Models/{ => Dto}/CheckUpdateModel.cs (89%) rename v2rayN/ServiceLib/Models/{ => Dto}/ClashConnectionModel.cs (93%) rename v2rayN/ServiceLib/Models/{ => Dto}/ClashConnections.cs (97%) rename v2rayN/ServiceLib/Models/{ => Dto}/ClashProviders.cs (80%) rename v2rayN/ServiceLib/Models/{ => Dto}/ClashProxies.cs (94%) rename v2rayN/ServiceLib/Models/{ => Dto}/ClashProxyModel.cs (90%) rename v2rayN/ServiceLib/Models/{ => Dto}/CmdItem.cs (77%) rename v2rayN/ServiceLib/Models/{ => Dto}/ComboItem.cs (80%) rename v2rayN/ServiceLib/Models/{ => Dto}/GitHubRelease.cs (98%) rename v2rayN/ServiceLib/Models/{ => Dto}/IPAPIInfo.cs (93%) rename v2rayN/ServiceLib/Models/{ => Dto}/ProfileItemModel.cs (97%) rename v2rayN/ServiceLib/Models/{ => Dto}/RetResult.cs (93%) rename v2rayN/ServiceLib/Models/{ => Dto}/RoutingItemModel.cs (65%) rename v2rayN/ServiceLib/Models/{ => Dto}/RoutingTemplate.cs (81%) rename v2rayN/ServiceLib/Models/{ => Dto}/RulesItemModel.cs (89%) rename v2rayN/ServiceLib/Models/{ => Dto}/SemanticVersion.cs (99%) rename v2rayN/ServiceLib/Models/{ => Dto}/ServerSpeedItem.cs (91%) rename v2rayN/ServiceLib/Models/{ => Dto}/ServerTestItem.cs (91%) rename v2rayN/ServiceLib/Models/{ => Dto}/SpeedTestResult.cs (83%) rename v2rayN/ServiceLib/Models/{ => Dto}/SsSIP008.cs (91%) rename v2rayN/ServiceLib/Models/{ => Dto}/UpdateResult.cs (92%) rename v2rayN/ServiceLib/Models/{ => Dto}/VmessQRCode.cs (97%) rename v2rayN/ServiceLib/Models/{ => Entities}/DNSItem.cs (92%) rename v2rayN/ServiceLib/Models/{ => Entities}/FullConfigTemplateItem.cs (91%) rename v2rayN/ServiceLib/Models/{ => Entities}/ProfileExItem.cs (86%) rename v2rayN/ServiceLib/Models/{ => Entities}/ProfileGroupItem.cs (93%) rename v2rayN/ServiceLib/Models/{ => Entities}/ProfileItem.cs (99%) rename v2rayN/ServiceLib/Models/{ => Entities}/ProtocolExtraItem.cs (97%) rename v2rayN/ServiceLib/Models/{ => Entities}/RoutingItem.cs (94%) rename v2rayN/ServiceLib/Models/{ => Entities}/RulesItem.cs (94%) rename v2rayN/ServiceLib/Models/{ => Entities}/ServerStatItem.cs (88%) rename v2rayN/ServiceLib/Models/{ => Entities}/SubItem.cs (94%) rename v2rayN/ServiceLib/Models/{ => Entities}/TransportExtraItem.cs (93%) diff --git a/v2rayN/ServiceLib.Tests/GlobalUsings.cs b/v2rayN/ServiceLib.Tests/GlobalUsings.cs new file mode 100644 index 00000000..9d311324 --- /dev/null +++ b/v2rayN/ServiceLib.Tests/GlobalUsings.cs @@ -0,0 +1,40 @@ +global using System.Collections.Concurrent; +global using System.Diagnostics; +global using System.Net; +global using System.Net.NetworkInformation; +global using System.Net.Sockets; +global using System.Reactive; +global using System.Reactive.Disposables; +global using System.Reactive.Linq; +global using System.Reflection; +global using System.Runtime.InteropServices; +global using System.Security.Cryptography; +global using System.Text; +global using System.Text.Encodings.Web; +global using System.Text.Json; +global using System.Text.Json.Nodes; +global using System.Text.Json.Serialization; +global using System.Text.RegularExpressions; +global using DynamicData; +global using DynamicData.Binding; +global using ReactiveUI; +global using ReactiveUI.Fody.Helpers; +global using ServiceLib.Base; +global using ServiceLib.Common; +global using ServiceLib.Enums; +global using ServiceLib.Events; +global using ServiceLib.Handler; +global using ServiceLib.Handler.Builder; +global using ServiceLib.Handler.Fmt; +global using ServiceLib.Handler.SysProxy; +global using ServiceLib.Helper; +global using ServiceLib.Manager; +global using ServiceLib.Models.CoreConfigs; +global using ServiceLib.Models.Configs; +global using ServiceLib.Models.Dto; +global using ServiceLib.Models.Entities; +global using ServiceLib.Resx; +global using ServiceLib.Services; +global using ServiceLib.Services.CoreConfig; +global using ServiceLib.Services.Statistics; +global using SQLite; diff --git a/v2rayN/ServiceLib/GlobalUsings.cs b/v2rayN/ServiceLib/GlobalUsings.cs index 4553cbc4..9d311324 100644 --- a/v2rayN/ServiceLib/GlobalUsings.cs +++ b/v2rayN/ServiceLib/GlobalUsings.cs @@ -29,7 +29,10 @@ global using ServiceLib.Handler.Fmt; global using ServiceLib.Handler.SysProxy; global using ServiceLib.Helper; global using ServiceLib.Manager; -global using ServiceLib.Models; +global using ServiceLib.Models.CoreConfigs; +global using ServiceLib.Models.Configs; +global using ServiceLib.Models.Dto; +global using ServiceLib.Models.Entities; global using ServiceLib.Resx; global using ServiceLib.Services; global using ServiceLib.Services.CoreConfig; diff --git a/v2rayN/ServiceLib/Manager/ClashApiManager.cs b/v2rayN/ServiceLib/Manager/ClashApiManager.cs index e34f838d..313060db 100644 --- a/v2rayN/ServiceLib/Manager/ClashApiManager.cs +++ b/v2rayN/ServiceLib/Manager/ClashApiManager.cs @@ -1,4 +1,4 @@ -using static ServiceLib.Models.ClashProxies; +using static ServiceLib.Models.Dto.ClashProxies; namespace ServiceLib.Manager; diff --git a/v2rayN/ServiceLib/Models/Config.cs b/v2rayN/ServiceLib/Models/Configs/Config.cs similarity index 97% rename from v2rayN/ServiceLib/Models/Config.cs rename to v2rayN/ServiceLib/Models/Configs/Config.cs index 738ee286..69770d3c 100644 --- a/v2rayN/ServiceLib/Models/Config.cs +++ b/v2rayN/ServiceLib/Models/Configs/Config.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Configs; [Serializable] public class Config diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs similarity index 99% rename from v2rayN/ServiceLib/Models/ConfigItems.cs rename to v2rayN/ServiceLib/Models/Configs/ConfigItems.cs index b23a8fc3..e9e7f5f8 100644 --- a/v2rayN/ServiceLib/Models/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Configs; [Serializable] public class CoreBasicItem diff --git a/v2rayN/ServiceLib/Models/CoreConfigContext.cs b/v2rayN/ServiceLib/Models/CoreConfigs/CoreConfigContext.cs similarity index 95% rename from v2rayN/ServiceLib/Models/CoreConfigContext.cs rename to v2rayN/ServiceLib/Models/CoreConfigs/CoreConfigContext.cs index 4b64efca..e1100868 100644 --- a/v2rayN/ServiceLib/Models/CoreConfigContext.cs +++ b/v2rayN/ServiceLib/Models/CoreConfigs/CoreConfigContext.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.CoreConfigs; public record CoreConfigContext { diff --git a/v2rayN/ServiceLib/Models/CoreInfo.cs b/v2rayN/ServiceLib/Models/CoreConfigs/CoreInfo.cs similarity index 95% rename from v2rayN/ServiceLib/Models/CoreInfo.cs rename to v2rayN/ServiceLib/Models/CoreConfigs/CoreInfo.cs index 087f57fe..dc55db91 100644 --- a/v2rayN/ServiceLib/Models/CoreInfo.cs +++ b/v2rayN/ServiceLib/Models/CoreConfigs/CoreInfo.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.CoreConfigs; [Serializable] public class CoreInfo diff --git a/v2rayN/ServiceLib/Models/SingboxConfig.cs b/v2rayN/ServiceLib/Models/CoreConfigs/SingboxConfig.cs similarity index 99% rename from v2rayN/ServiceLib/Models/SingboxConfig.cs rename to v2rayN/ServiceLib/Models/CoreConfigs/SingboxConfig.cs index 0e2bb530..1514cae4 100644 --- a/v2rayN/ServiceLib/Models/SingboxConfig.cs +++ b/v2rayN/ServiceLib/Models/CoreConfigs/SingboxConfig.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.CoreConfigs; public class SingboxConfig { diff --git a/v2rayN/ServiceLib/Models/V2rayConfig.cs b/v2rayN/ServiceLib/Models/CoreConfigs/V2rayConfig.cs similarity index 99% rename from v2rayN/ServiceLib/Models/V2rayConfig.cs rename to v2rayN/ServiceLib/Models/CoreConfigs/V2rayConfig.cs index 10420dad..4daac3c6 100644 --- a/v2rayN/ServiceLib/Models/V2rayConfig.cs +++ b/v2rayN/ServiceLib/Models/CoreConfigs/V2rayConfig.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.CoreConfigs; public class V2rayConfig { diff --git a/v2rayN/ServiceLib/Models/V2rayMetricsVars.cs b/v2rayN/ServiceLib/Models/CoreConfigs/V2rayMetricsVars.cs similarity index 88% rename from v2rayN/ServiceLib/Models/V2rayMetricsVars.cs rename to v2rayN/ServiceLib/Models/CoreConfigs/V2rayMetricsVars.cs index cc8d64bd..ed963f42 100644 --- a/v2rayN/ServiceLib/Models/V2rayMetricsVars.cs +++ b/v2rayN/ServiceLib/Models/CoreConfigs/V2rayMetricsVars.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace ServiceLib.Models; +namespace ServiceLib.Models.CoreConfigs; internal class V2rayMetricsVars { diff --git a/v2rayN/ServiceLib/Models/V2rayTcpRequest.cs b/v2rayN/ServiceLib/Models/CoreConfigs/V2rayTcpRequest.cs similarity index 85% rename from v2rayN/ServiceLib/Models/V2rayTcpRequest.cs rename to v2rayN/ServiceLib/Models/CoreConfigs/V2rayTcpRequest.cs index c08284b4..7b231a13 100644 --- a/v2rayN/ServiceLib/Models/V2rayTcpRequest.cs +++ b/v2rayN/ServiceLib/Models/CoreConfigs/V2rayTcpRequest.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.CoreConfigs; public class V2rayTcpRequest { diff --git a/v2rayN/ServiceLib/Models/CheckUpdateModel.cs b/v2rayN/ServiceLib/Models/Dto/CheckUpdateModel.cs similarity index 89% rename from v2rayN/ServiceLib/Models/CheckUpdateModel.cs rename to v2rayN/ServiceLib/Models/Dto/CheckUpdateModel.cs index 2707cc6e..8ccb8a39 100644 --- a/v2rayN/ServiceLib/Models/CheckUpdateModel.cs +++ b/v2rayN/ServiceLib/Models/Dto/CheckUpdateModel.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class CheckUpdateModel : ReactiveObject { diff --git a/v2rayN/ServiceLib/Models/ClashConnectionModel.cs b/v2rayN/ServiceLib/Models/Dto/ClashConnectionModel.cs similarity index 93% rename from v2rayN/ServiceLib/Models/ClashConnectionModel.cs rename to v2rayN/ServiceLib/Models/Dto/ClashConnectionModel.cs index 12411852..943f1fd6 100644 --- a/v2rayN/ServiceLib/Models/ClashConnectionModel.cs +++ b/v2rayN/ServiceLib/Models/Dto/ClashConnectionModel.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class ClashConnectionModel { diff --git a/v2rayN/ServiceLib/Models/ClashConnections.cs b/v2rayN/ServiceLib/Models/Dto/ClashConnections.cs similarity index 97% rename from v2rayN/ServiceLib/Models/ClashConnections.cs rename to v2rayN/ServiceLib/Models/Dto/ClashConnections.cs index 7ac2bbd2..236e2668 100644 --- a/v2rayN/ServiceLib/Models/ClashConnections.cs +++ b/v2rayN/ServiceLib/Models/Dto/ClashConnections.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class ClashConnections { diff --git a/v2rayN/ServiceLib/Models/ClashProviders.cs b/v2rayN/ServiceLib/Models/Dto/ClashProviders.cs similarity index 80% rename from v2rayN/ServiceLib/Models/ClashProviders.cs rename to v2rayN/ServiceLib/Models/Dto/ClashProviders.cs index 402add5d..83040906 100644 --- a/v2rayN/ServiceLib/Models/ClashProviders.cs +++ b/v2rayN/ServiceLib/Models/Dto/ClashProviders.cs @@ -1,6 +1,6 @@ -using static ServiceLib.Models.ClashProxies; +using static ServiceLib.Models.Dto.ClashProxies; -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class ClashProviders { diff --git a/v2rayN/ServiceLib/Models/ClashProxies.cs b/v2rayN/ServiceLib/Models/Dto/ClashProxies.cs similarity index 94% rename from v2rayN/ServiceLib/Models/ClashProxies.cs rename to v2rayN/ServiceLib/Models/Dto/ClashProxies.cs index 97028b70..94986e50 100644 --- a/v2rayN/ServiceLib/Models/ClashProxies.cs +++ b/v2rayN/ServiceLib/Models/Dto/ClashProxies.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class ClashProxies { diff --git a/v2rayN/ServiceLib/Models/ClashProxyModel.cs b/v2rayN/ServiceLib/Models/Dto/ClashProxyModel.cs similarity index 90% rename from v2rayN/ServiceLib/Models/ClashProxyModel.cs rename to v2rayN/ServiceLib/Models/Dto/ClashProxyModel.cs index 10d68e14..5e460d9f 100644 --- a/v2rayN/ServiceLib/Models/ClashProxyModel.cs +++ b/v2rayN/ServiceLib/Models/Dto/ClashProxyModel.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; [Serializable] public class ClashProxyModel : ReactiveObject diff --git a/v2rayN/ServiceLib/Models/CmdItem.cs b/v2rayN/ServiceLib/Models/Dto/CmdItem.cs similarity index 77% rename from v2rayN/ServiceLib/Models/CmdItem.cs rename to v2rayN/ServiceLib/Models/Dto/CmdItem.cs index a660208e..7b9813af 100644 --- a/v2rayN/ServiceLib/Models/CmdItem.cs +++ b/v2rayN/ServiceLib/Models/Dto/CmdItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class CmdItem { diff --git a/v2rayN/ServiceLib/Models/ComboItem.cs b/v2rayN/ServiceLib/Models/Dto/ComboItem.cs similarity index 80% rename from v2rayN/ServiceLib/Models/ComboItem.cs rename to v2rayN/ServiceLib/Models/Dto/ComboItem.cs index c092f437..fec6fd9d 100644 --- a/v2rayN/ServiceLib/Models/ComboItem.cs +++ b/v2rayN/ServiceLib/Models/Dto/ComboItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class ComboItem { diff --git a/v2rayN/ServiceLib/Models/GitHubRelease.cs b/v2rayN/ServiceLib/Models/Dto/GitHubRelease.cs similarity index 98% rename from v2rayN/ServiceLib/Models/GitHubRelease.cs rename to v2rayN/ServiceLib/Models/Dto/GitHubRelease.cs index f6549467..ed2f48c8 100644 --- a/v2rayN/ServiceLib/Models/GitHubRelease.cs +++ b/v2rayN/ServiceLib/Models/Dto/GitHubRelease.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class GitHubReleaseAsset { diff --git a/v2rayN/ServiceLib/Models/IPAPIInfo.cs b/v2rayN/ServiceLib/Models/Dto/IPAPIInfo.cs similarity index 93% rename from v2rayN/ServiceLib/Models/IPAPIInfo.cs rename to v2rayN/ServiceLib/Models/Dto/IPAPIInfo.cs index 86cfe111..e1e14363 100644 --- a/v2rayN/ServiceLib/Models/IPAPIInfo.cs +++ b/v2rayN/ServiceLib/Models/Dto/IPAPIInfo.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; internal class IPAPIInfo { diff --git a/v2rayN/ServiceLib/Models/ProfileItemModel.cs b/v2rayN/ServiceLib/Models/Dto/ProfileItemModel.cs similarity index 97% rename from v2rayN/ServiceLib/Models/ProfileItemModel.cs rename to v2rayN/ServiceLib/Models/Dto/ProfileItemModel.cs index 53170f17..b75835a4 100644 --- a/v2rayN/ServiceLib/Models/ProfileItemModel.cs +++ b/v2rayN/ServiceLib/Models/Dto/ProfileItemModel.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; [Serializable] public class ProfileItemModel : ReactiveObject diff --git a/v2rayN/ServiceLib/Models/RetResult.cs b/v2rayN/ServiceLib/Models/Dto/RetResult.cs similarity index 93% rename from v2rayN/ServiceLib/Models/RetResult.cs rename to v2rayN/ServiceLib/Models/Dto/RetResult.cs index 688eca3e..3d6c9345 100644 --- a/v2rayN/ServiceLib/Models/RetResult.cs +++ b/v2rayN/ServiceLib/Models/Dto/RetResult.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class RetResult { diff --git a/v2rayN/ServiceLib/Models/RoutingItemModel.cs b/v2rayN/ServiceLib/Models/Dto/RoutingItemModel.cs similarity index 65% rename from v2rayN/ServiceLib/Models/RoutingItemModel.cs rename to v2rayN/ServiceLib/Models/Dto/RoutingItemModel.cs index 2326f85b..2abde924 100644 --- a/v2rayN/ServiceLib/Models/RoutingItemModel.cs +++ b/v2rayN/ServiceLib/Models/Dto/RoutingItemModel.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; [Serializable] public class RoutingItemModel : RoutingItem diff --git a/v2rayN/ServiceLib/Models/RoutingTemplate.cs b/v2rayN/ServiceLib/Models/Dto/RoutingTemplate.cs similarity index 81% rename from v2rayN/ServiceLib/Models/RoutingTemplate.cs rename to v2rayN/ServiceLib/Models/Dto/RoutingTemplate.cs index 0cacc1bb..0d3fd808 100644 --- a/v2rayN/ServiceLib/Models/RoutingTemplate.cs +++ b/v2rayN/ServiceLib/Models/Dto/RoutingTemplate.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; [Serializable] public class RoutingTemplate diff --git a/v2rayN/ServiceLib/Models/RulesItemModel.cs b/v2rayN/ServiceLib/Models/Dto/RulesItemModel.cs similarity index 89% rename from v2rayN/ServiceLib/Models/RulesItemModel.cs rename to v2rayN/ServiceLib/Models/Dto/RulesItemModel.cs index f3eda16b..b056f47c 100644 --- a/v2rayN/ServiceLib/Models/RulesItemModel.cs +++ b/v2rayN/ServiceLib/Models/Dto/RulesItemModel.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; [Serializable] public class RulesItemModel : RulesItem diff --git a/v2rayN/ServiceLib/Models/SemanticVersion.cs b/v2rayN/ServiceLib/Models/Dto/SemanticVersion.cs similarity index 99% rename from v2rayN/ServiceLib/Models/SemanticVersion.cs rename to v2rayN/ServiceLib/Models/Dto/SemanticVersion.cs index 78463434..1e66353c 100644 --- a/v2rayN/ServiceLib/Models/SemanticVersion.cs +++ b/v2rayN/ServiceLib/Models/Dto/SemanticVersion.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class SemanticVersion { diff --git a/v2rayN/ServiceLib/Models/ServerSpeedItem.cs b/v2rayN/ServiceLib/Models/Dto/ServerSpeedItem.cs similarity index 91% rename from v2rayN/ServiceLib/Models/ServerSpeedItem.cs rename to v2rayN/ServiceLib/Models/Dto/ServerSpeedItem.cs index 0a859af6..3d9e7562 100644 --- a/v2rayN/ServiceLib/Models/ServerSpeedItem.cs +++ b/v2rayN/ServiceLib/Models/Dto/ServerSpeedItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; [Serializable] public class ServerSpeedItem : ServerStatItem diff --git a/v2rayN/ServiceLib/Models/ServerTestItem.cs b/v2rayN/ServiceLib/Models/Dto/ServerTestItem.cs similarity index 91% rename from v2rayN/ServiceLib/Models/ServerTestItem.cs rename to v2rayN/ServiceLib/Models/Dto/ServerTestItem.cs index 00e26b83..66d33255 100644 --- a/v2rayN/ServiceLib/Models/ServerTestItem.cs +++ b/v2rayN/ServiceLib/Models/Dto/ServerTestItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; [Serializable] public class ServerTestItem diff --git a/v2rayN/ServiceLib/Models/SpeedTestResult.cs b/v2rayN/ServiceLib/Models/Dto/SpeedTestResult.cs similarity index 83% rename from v2rayN/ServiceLib/Models/SpeedTestResult.cs rename to v2rayN/ServiceLib/Models/Dto/SpeedTestResult.cs index 6e0ce70f..bac7bf0f 100644 --- a/v2rayN/ServiceLib/Models/SpeedTestResult.cs +++ b/v2rayN/ServiceLib/Models/Dto/SpeedTestResult.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; [Serializable] public class SpeedTestResult diff --git a/v2rayN/ServiceLib/Models/SsSIP008.cs b/v2rayN/ServiceLib/Models/Dto/SsSIP008.cs similarity index 91% rename from v2rayN/ServiceLib/Models/SsSIP008.cs rename to v2rayN/ServiceLib/Models/Dto/SsSIP008.cs index 66077471..d6f05faf 100644 --- a/v2rayN/ServiceLib/Models/SsSIP008.cs +++ b/v2rayN/ServiceLib/Models/Dto/SsSIP008.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class SsSIP008 { diff --git a/v2rayN/ServiceLib/Models/UpdateResult.cs b/v2rayN/ServiceLib/Models/Dto/UpdateResult.cs similarity index 92% rename from v2rayN/ServiceLib/Models/UpdateResult.cs rename to v2rayN/ServiceLib/Models/Dto/UpdateResult.cs index d8f18dd4..42a3b352 100644 --- a/v2rayN/ServiceLib/Models/UpdateResult.cs +++ b/v2rayN/ServiceLib/Models/Dto/UpdateResult.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; public class UpdateResult { diff --git a/v2rayN/ServiceLib/Models/VmessQRCode.cs b/v2rayN/ServiceLib/Models/Dto/VmessQRCode.cs similarity index 97% rename from v2rayN/ServiceLib/Models/VmessQRCode.cs rename to v2rayN/ServiceLib/Models/Dto/VmessQRCode.cs index f182c328..c259cf77 100644 --- a/v2rayN/ServiceLib/Models/VmessQRCode.cs +++ b/v2rayN/ServiceLib/Models/Dto/VmessQRCode.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Dto; /// /// https://github.com/2dust/v2rayN/wiki/ diff --git a/v2rayN/ServiceLib/Models/DNSItem.cs b/v2rayN/ServiceLib/Models/Entities/DNSItem.cs similarity index 92% rename from v2rayN/ServiceLib/Models/DNSItem.cs rename to v2rayN/ServiceLib/Models/Entities/DNSItem.cs index 2dea42d0..4bb4f65a 100644 --- a/v2rayN/ServiceLib/Models/DNSItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/DNSItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Serializable] public class DNSItem diff --git a/v2rayN/ServiceLib/Models/FullConfigTemplateItem.cs b/v2rayN/ServiceLib/Models/Entities/FullConfigTemplateItem.cs similarity index 91% rename from v2rayN/ServiceLib/Models/FullConfigTemplateItem.cs rename to v2rayN/ServiceLib/Models/Entities/FullConfigTemplateItem.cs index b3e3b14e..c51aa55e 100644 --- a/v2rayN/ServiceLib/Models/FullConfigTemplateItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/FullConfigTemplateItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Serializable] public class FullConfigTemplateItem diff --git a/v2rayN/ServiceLib/Models/ProfileExItem.cs b/v2rayN/ServiceLib/Models/Entities/ProfileExItem.cs similarity index 86% rename from v2rayN/ServiceLib/Models/ProfileExItem.cs rename to v2rayN/ServiceLib/Models/Entities/ProfileExItem.cs index 33b20c57..7d2cc789 100644 --- a/v2rayN/ServiceLib/Models/ProfileExItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/ProfileExItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Serializable] public class ProfileExItem diff --git a/v2rayN/ServiceLib/Models/ProfileGroupItem.cs b/v2rayN/ServiceLib/Models/Entities/ProfileGroupItem.cs similarity index 93% rename from v2rayN/ServiceLib/Models/ProfileGroupItem.cs rename to v2rayN/ServiceLib/Models/Entities/ProfileGroupItem.cs index 94a9aad2..6a878a50 100644 --- a/v2rayN/ServiceLib/Models/ProfileGroupItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/ProfileGroupItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Obsolete("Use ProtocolExtraItem instead.")] [Serializable] diff --git a/v2rayN/ServiceLib/Models/ProfileItem.cs b/v2rayN/ServiceLib/Models/Entities/ProfileItem.cs similarity index 99% rename from v2rayN/ServiceLib/Models/ProfileItem.cs rename to v2rayN/ServiceLib/Models/Entities/ProfileItem.cs index ae5f77ad..cb5deabd 100644 --- a/v2rayN/ServiceLib/Models/ProfileItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/ProfileItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Serializable] public class ProfileItem diff --git a/v2rayN/ServiceLib/Models/ProtocolExtraItem.cs b/v2rayN/ServiceLib/Models/Entities/ProtocolExtraItem.cs similarity index 97% rename from v2rayN/ServiceLib/Models/ProtocolExtraItem.cs rename to v2rayN/ServiceLib/Models/Entities/ProtocolExtraItem.cs index 03403f5b..e9916e33 100644 --- a/v2rayN/ServiceLib/Models/ProtocolExtraItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/ProtocolExtraItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; public record ProtocolExtraItem { diff --git a/v2rayN/ServiceLib/Models/RoutingItem.cs b/v2rayN/ServiceLib/Models/Entities/RoutingItem.cs similarity index 94% rename from v2rayN/ServiceLib/Models/RoutingItem.cs rename to v2rayN/ServiceLib/Models/Entities/RoutingItem.cs index ddd27a9b..fae611e7 100644 --- a/v2rayN/ServiceLib/Models/RoutingItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/RoutingItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Serializable] public class RoutingItem diff --git a/v2rayN/ServiceLib/Models/RulesItem.cs b/v2rayN/ServiceLib/Models/Entities/RulesItem.cs similarity index 94% rename from v2rayN/ServiceLib/Models/RulesItem.cs rename to v2rayN/ServiceLib/Models/Entities/RulesItem.cs index 5a5cf529..5c7c07d8 100644 --- a/v2rayN/ServiceLib/Models/RulesItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/RulesItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Serializable] public class RulesItem diff --git a/v2rayN/ServiceLib/Models/ServerStatItem.cs b/v2rayN/ServiceLib/Models/Entities/ServerStatItem.cs similarity index 88% rename from v2rayN/ServiceLib/Models/ServerStatItem.cs rename to v2rayN/ServiceLib/Models/Entities/ServerStatItem.cs index 05cd1ee6..a693fa4e 100644 --- a/v2rayN/ServiceLib/Models/ServerStatItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/ServerStatItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Serializable] public class ServerStatItem diff --git a/v2rayN/ServiceLib/Models/SubItem.cs b/v2rayN/ServiceLib/Models/Entities/SubItem.cs similarity index 94% rename from v2rayN/ServiceLib/Models/SubItem.cs rename to v2rayN/ServiceLib/Models/Entities/SubItem.cs index 612ec15b..a66eb4ce 100644 --- a/v2rayN/ServiceLib/Models/SubItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/SubItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; [Serializable] public class SubItem diff --git a/v2rayN/ServiceLib/Models/TransportExtraItem.cs b/v2rayN/ServiceLib/Models/Entities/TransportExtraItem.cs similarity index 93% rename from v2rayN/ServiceLib/Models/TransportExtraItem.cs rename to v2rayN/ServiceLib/Models/Entities/TransportExtraItem.cs index 77fbc984..b454f022 100644 --- a/v2rayN/ServiceLib/Models/TransportExtraItem.cs +++ b/v2rayN/ServiceLib/Models/Entities/TransportExtraItem.cs @@ -1,4 +1,4 @@ -namespace ServiceLib.Models; +namespace ServiceLib.Models.Entities; public record TransportExtraItem { diff --git a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs index 6220719b..7da8ad42 100644 --- a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs @@ -1,6 +1,6 @@ using System.Reactive.Concurrency; -using static ServiceLib.Models.ClashProviders; -using static ServiceLib.Models.ClashProxies; +using static ServiceLib.Models.Dto.ClashProviders; +using static ServiceLib.Models.Dto.ClashProxies; namespace ServiceLib.ViewModels; diff --git a/v2rayN/v2rayN.Desktop/GlobalUsings.cs b/v2rayN/v2rayN.Desktop/GlobalUsings.cs index 5b0b2158..9c28c767 100644 --- a/v2rayN/v2rayN.Desktop/GlobalUsings.cs +++ b/v2rayN/v2rayN.Desktop/GlobalUsings.cs @@ -30,6 +30,9 @@ global using ServiceLib.Enums; global using ServiceLib.Events; global using ServiceLib.Handler; global using ServiceLib.Manager; -global using ServiceLib.Models; +global using ServiceLib.Models.CoreConfigs; +global using ServiceLib.Models.Configs; +global using ServiceLib.Models.Dto; +global using ServiceLib.Models.Entities; global using ServiceLib.Resx; global using ServiceLib.ViewModels; diff --git a/v2rayN/v2rayN/GlobalUsings.cs b/v2rayN/v2rayN/GlobalUsings.cs index fb63f7eb..5bd45390 100644 --- a/v2rayN/v2rayN/GlobalUsings.cs +++ b/v2rayN/v2rayN/GlobalUsings.cs @@ -29,7 +29,10 @@ global using ServiceLib.Enums; global using ServiceLib.Events; global using ServiceLib.Handler; global using ServiceLib.Manager; -global using ServiceLib.Models; +global using ServiceLib.Models.CoreConfigs; +global using ServiceLib.Models.Configs; +global using ServiceLib.Models.Dto; +global using ServiceLib.Models.Entities; global using ServiceLib.Resx; global using ServiceLib.ViewModels; global using v2rayN.Common;