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

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;

View file

@ -29,7 +29,10 @@ global using ServiceLib.Handler.Fmt;
global using ServiceLib.Handler.SysProxy; global using ServiceLib.Handler.SysProxy;
global using ServiceLib.Helper; global using ServiceLib.Helper;
global using ServiceLib.Manager; 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.Resx;
global using ServiceLib.Services; global using ServiceLib.Services;
global using ServiceLib.Services.CoreConfig; global using ServiceLib.Services.CoreConfig;

View file

@ -1,4 +1,4 @@
using static ServiceLib.Models.ClashProxies; using static ServiceLib.Models.Dto.ClashProxies;
namespace ServiceLib.Manager; namespace ServiceLib.Manager;

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Configs;
[Serializable] [Serializable]
public class Config public class Config

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Configs;
[Serializable] [Serializable]
public class CoreBasicItem public class CoreBasicItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.CoreConfigs;
public record CoreConfigContext public record CoreConfigContext
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.CoreConfigs;
[Serializable] [Serializable]
public class CoreInfo public class CoreInfo

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.CoreConfigs;
public class SingboxConfig public class SingboxConfig
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.CoreConfigs;
public class V2rayConfig public class V2rayConfig
{ {

View file

@ -1,6 +1,6 @@
using System.Collections; using System.Collections;
namespace ServiceLib.Models; namespace ServiceLib.Models.CoreConfigs;
internal class V2rayMetricsVars internal class V2rayMetricsVars
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.CoreConfigs;
public class V2rayTcpRequest public class V2rayTcpRequest
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class CheckUpdateModel : ReactiveObject public class CheckUpdateModel : ReactiveObject
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class ClashConnectionModel public class ClashConnectionModel
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class ClashConnections public class ClashConnections
{ {

View file

@ -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 public class ClashProviders
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class ClashProxies public class ClashProxies
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
[Serializable] [Serializable]
public class ClashProxyModel : ReactiveObject public class ClashProxyModel : ReactiveObject

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class CmdItem public class CmdItem
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class ComboItem public class ComboItem
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class GitHubReleaseAsset public class GitHubReleaseAsset
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
internal class IPAPIInfo internal class IPAPIInfo
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
[Serializable] [Serializable]
public class ProfileItemModel : ReactiveObject public class ProfileItemModel : ReactiveObject

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class RetResult public class RetResult
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
[Serializable] [Serializable]
public class RoutingItemModel : RoutingItem public class RoutingItemModel : RoutingItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
[Serializable] [Serializable]
public class RoutingTemplate public class RoutingTemplate

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
[Serializable] [Serializable]
public class RulesItemModel : RulesItem public class RulesItemModel : RulesItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class SemanticVersion public class SemanticVersion
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
[Serializable] [Serializable]
public class ServerSpeedItem : ServerStatItem public class ServerSpeedItem : ServerStatItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
[Serializable] [Serializable]
public class ServerTestItem public class ServerTestItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
[Serializable] [Serializable]
public class SpeedTestResult public class SpeedTestResult

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class SsSIP008 public class SsSIP008
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
public class UpdateResult public class UpdateResult
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Dto;
/// <summary> /// <summary>
/// https://github.com/2dust/v2rayN/wiki/ /// https://github.com/2dust/v2rayN/wiki/

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Serializable] [Serializable]
public class DNSItem public class DNSItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Serializable] [Serializable]
public class FullConfigTemplateItem public class FullConfigTemplateItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Serializable] [Serializable]
public class ProfileExItem public class ProfileExItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Obsolete("Use ProtocolExtraItem instead.")] [Obsolete("Use ProtocolExtraItem instead.")]
[Serializable] [Serializable]

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Serializable] [Serializable]
public class ProfileItem public class ProfileItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
public record ProtocolExtraItem public record ProtocolExtraItem
{ {

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Serializable] [Serializable]
public class RoutingItem public class RoutingItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Serializable] [Serializable]
public class RulesItem public class RulesItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Serializable] [Serializable]
public class ServerStatItem public class ServerStatItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
[Serializable] [Serializable]
public class SubItem public class SubItem

View file

@ -1,4 +1,4 @@
namespace ServiceLib.Models; namespace ServiceLib.Models.Entities;
public record TransportExtraItem public record TransportExtraItem
{ {

View file

@ -1,6 +1,6 @@
using System.Reactive.Concurrency; using System.Reactive.Concurrency;
using static ServiceLib.Models.ClashProviders; using static ServiceLib.Models.Dto.ClashProviders;
using static ServiceLib.Models.ClashProxies; using static ServiceLib.Models.Dto.ClashProxies;
namespace ServiceLib.ViewModels; namespace ServiceLib.ViewModels;

View file

@ -30,6 +30,9 @@ global using ServiceLib.Enums;
global using ServiceLib.Events; global using ServiceLib.Events;
global using ServiceLib.Handler; global using ServiceLib.Handler;
global using ServiceLib.Manager; 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.Resx;
global using ServiceLib.ViewModels; global using ServiceLib.ViewModels;

View file

@ -29,7 +29,10 @@ global using ServiceLib.Enums;
global using ServiceLib.Events; global using ServiceLib.Events;
global using ServiceLib.Handler; global using ServiceLib.Handler;
global using ServiceLib.Manager; 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.Resx;
global using ServiceLib.ViewModels; global using ServiceLib.ViewModels;
global using v2rayN.Common; global using v2rayN.Common;