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.
This commit is contained in:
2dust
2026-05-11 11:00:19 +08:00
parent 700f98193a
commit 8090799ccc
47 changed files with 97 additions and 48 deletions
+40
View File
@@ -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;
+4 -1
View File
@@ -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;
+1 -1
View File
@@ -1,4 +1,4 @@
using static ServiceLib.Models.ClashProxies;
using static ServiceLib.Models.Dto.ClashProxies;
namespace ServiceLib.Manager;
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Configs;
[Serializable]
public class Config
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Configs;
[Serializable]
public class CoreBasicItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.CoreConfigs;
public record CoreConfigContext
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.CoreConfigs;
[Serializable]
public class CoreInfo
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.CoreConfigs;
public class SingboxConfig
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.CoreConfigs;
public class V2rayConfig
{
@@ -1,6 +1,6 @@
using System.Collections;
namespace ServiceLib.Models;
namespace ServiceLib.Models.CoreConfigs;
internal class V2rayMetricsVars
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.CoreConfigs;
public class V2rayTcpRequest
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class CheckUpdateModel : ReactiveObject
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class ClashConnectionModel
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class ClashConnections
{
@@ -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
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class ClashProxies
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
[Serializable]
public class ClashProxyModel : ReactiveObject
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class CmdItem
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class ComboItem
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class GitHubReleaseAsset
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
internal class IPAPIInfo
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
[Serializable]
public class ProfileItemModel : ReactiveObject
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class RetResult
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
[Serializable]
public class RoutingItemModel : RoutingItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
[Serializable]
public class RoutingTemplate
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
[Serializable]
public class RulesItemModel : RulesItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class SemanticVersion
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
[Serializable]
public class ServerSpeedItem : ServerStatItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
[Serializable]
public class ServerTestItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
[Serializable]
public class SpeedTestResult
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class SsSIP008
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
public class UpdateResult
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Dto;
/// <summary>
/// https://github.com/2dust/v2rayN/wiki/
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Serializable]
public class DNSItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Serializable]
public class FullConfigTemplateItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Serializable]
public class ProfileExItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Obsolete("Use ProtocolExtraItem instead.")]
[Serializable]
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Serializable]
public class ProfileItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
public record ProtocolExtraItem
{
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Serializable]
public class RoutingItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Serializable]
public class RulesItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Serializable]
public class ServerStatItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
[Serializable]
public class SubItem
@@ -1,4 +1,4 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models.Entities;
public record TransportExtraItem
{
@@ -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;
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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;