feat: 目前完成了订阅功能和 Xray-Core 的更新管理.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace Proxd_man.Config.Stream;
|
||||
|
||||
public abstract class BaseStreamSetting
|
||||
{
|
||||
|
||||
public StreamType StreamType { get; init; }
|
||||
|
||||
public JsonObject ToJsonSetting()
|
||||
{
|
||||
var setting = new JsonObject
|
||||
{
|
||||
{ "network", StreamType.ToString().ToLower() }
|
||||
};
|
||||
|
||||
var specificSettingFieldName = GetSpecificSettingFieldName();
|
||||
if (!string.IsNullOrEmpty(specificSettingFieldName))
|
||||
{
|
||||
setting.Add(specificSettingFieldName, ToJsonSpecificSetting());
|
||||
}
|
||||
|
||||
return setting;
|
||||
}
|
||||
|
||||
protected abstract string? GetSpecificSettingFieldName();
|
||||
|
||||
protected abstract JsonObject? ToJsonSpecificSetting();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user