其他指令也一次性添加上去

dev
nxiaoxiao 1 year ago
parent 829bf729e5
commit 2550084b66

@ -0,0 +1,31 @@
using System.Text.Json;
namespace OMS.NET.Instructs
{
public class BatchDeleteElementInstruct : Instruct
{
public BatchDeleteElementInstruct()
{
Type = "broadcast";
Class = "batchDeleteElement";
}
public override Task Handler(string wsid)
{
return Task.Run(() =>
{
if (!GlobalArea.LoginCheckByID(wsid)) return;//登录检查不通过则直接退出
if (Data?.GetType() != typeof(JsonElement)) return;//Data 非空和JsonElement类型检查
try
{
//string conveyor = GlobalArea.GetLoginEmailByID(wsid);
string time = GlobalArea.GetCurrentTime();
}
catch (Exception ex)
{
GlobalArea.Log.Warn($"处理{Class}广播指令出错:" + ex.Message);
}
});
}
}
}

@ -0,0 +1,31 @@
using System.Text.Json;
namespace OMS.NET.Instructs
{
public class DeleteLayerAndMembersInstuct : Instruct
{
public DeleteLayerAndMembersInstuct()
{
Type = "broadcast";
Class = "deleteLayerAndMembers";
}
public override Task Handler(string wsid)
{
return Task.Run(() =>
{
if (!GlobalArea.LoginCheckByID(wsid)) return;//登录检查不通过则直接退出
if (Data?.GetType() != typeof(JsonElement)) return;//Data 非空和JsonElement类型检查
try
{
//string conveyor = GlobalArea.GetLoginEmailByID(wsid);
string time = GlobalArea.GetCurrentTime();
}
catch (Exception ex)
{
GlobalArea.Log.Warn($"处理{Class}广播指令出错:" + ex.Message);
}
});
}
}
}

@ -0,0 +1,31 @@
using System.Text.Json;
namespace OMS.NET.Instructs
{
public class ForceUpdateDataInstruct : Instruct
{
public ForceUpdateDataInstruct()
{
Type = "broadcast";
Class = "forceUpdate";
}
public override Task Handler(string wsid)
{
return Task.Run(() =>
{
if (!GlobalArea.LoginCheckByID(wsid)) return;//登录检查不通过则直接退出
if (Data?.GetType() != typeof(JsonElement)) return;//Data 非空和JsonElement类型检查
try
{
//string conveyor = GlobalArea.GetLoginEmailByID(wsid);
string time = GlobalArea.GetCurrentTime();
}
catch (Exception ex)
{
GlobalArea.Log.Warn($"处理{Class}广播指令出错:" + ex.Message);
}
});
}
}
}

@ -55,7 +55,6 @@ namespace OMS.NET.Instructs
"get_mapLayer" => JsonSerializer.Deserialize<GetMapLayerInstruct>(root.GetRawText(), options),
"get_activeData" => JsonSerializer.Deserialize<GetActiveDataInstruct>(root.GetRawText(), options),
"ping" => JsonSerializer.Deserialize<PingInstuct>(root.GetRawText(), options),
//广播指令
"broadcast" => classValue switch
{
@ -66,10 +65,20 @@ namespace OMS.NET.Instructs
"curve" => JsonSerializer.Deserialize<AddElementInstruct>(root.GetRawText(), options),
"deleteElement" => JsonSerializer.Deserialize<DeleteElementInstruct>(root.GetRawText(), options),
"textMessage" => JsonSerializer.Deserialize<TextMessageInstruct>(root.GetRawText(), options),
"updateElement" => JsonSerializer.Deserialize<UpdateElementInstuct>(root.GetRawText(), options),
"updateElementNode" => JsonSerializer.Deserialize<UpdateElementNodeInstuct>(root.GetRawText(), options),
"selectIngElement" => JsonSerializer.Deserialize<SelectIngElementInstruct>(root.GetRawText(), options),
"selectEndElement" => JsonSerializer.Deserialize<SelectEndElementInstruct>(root.GetRawText(), options),
"pickIngElement" => JsonSerializer.Deserialize<PickIngElementInstruct>(root.GetRawText(), options),
"pickEndElement" => JsonSerializer.Deserialize<PickEndElementInstruct>(root.GetRawText(), options),
"restoreElement" => JsonSerializer.Deserialize<RestoreElementInstruct>(root.GetRawText(), options),
"adjustElementOrder" => JsonSerializer.Deserialize<AdjustElementOrderInstuct>(root.GetRawText(), options),
"updateLayerOrder" => JsonSerializer.Deserialize<UpdateLayerOrderInstruct>(root.GetRawText(), options),
"createGroupLayer" => JsonSerializer.Deserialize<CreateGroupLayerInstruct>(root.GetRawText(), options),
"deleteLayerAndMembers" => JsonSerializer.Deserialize<DeleteLayerAndMembersInstuct>(root.GetRawText(), options),
"batchDeleteElement" => JsonSerializer.Deserialize<BatchDeleteElementInstruct>(root.GetRawText(), options),
"renameLayer" => JsonSerializer.Deserialize<RenameLayerInstruct>(root.GetRawText(), options),
"updateTemplateData" => JsonSerializer.Deserialize<UpdateTemplateDataInstruct>(root.GetRawText(), options),
_ => JsonSerializer.Deserialize<Instruct>(root.GetRawText(), options)
},
_ => null

@ -0,0 +1,31 @@
using System.Text.Json;
namespace OMS.NET.Instructs
{
public class RenameLayerInstruct : Instruct
{
public RenameLayerInstruct()
{
Type = "broadcast";
Class = "renameLayer";
}
public override Task Handler(string wsid)
{
return Task.Run(() =>
{
if (!GlobalArea.LoginCheckByID(wsid)) return;//登录检查不通过则直接退出
if (Data?.GetType() != typeof(JsonElement)) return;//Data 非空和JsonElement类型检查
try
{
//string conveyor = GlobalArea.GetLoginEmailByID(wsid);
string time = GlobalArea.GetCurrentTime();
}
catch (Exception ex)
{
GlobalArea.Log.Warn($"处理{Class}广播指令出错:" + ex.Message);
}
});
}
}
}

@ -0,0 +1,31 @@
using System.Text.Json;
namespace OMS.NET.Instructs
{
public class UpdateTemplateDataInstruct : Instruct
{
public UpdateTemplateDataInstruct()
{
Type = "broadcast";
Class = "updateTemplateData";
}
public override Task Handler(string wsid)
{
return Task.Run(() =>
{
if (!GlobalArea.LoginCheckByID(wsid)) return;//登录检查不通过则直接退出
if (Data?.GetType() != typeof(JsonElement)) return;//Data 非空和JsonElement类型检查
try
{
//string conveyor = GlobalArea.GetLoginEmailByID(wsid);
string time = GlobalArea.GetCurrentTime();
}
catch (Exception ex)
{
GlobalArea.Log.Warn($"处理{Class}广播指令出错:" + ex.Message);
}
});
}
}
}
Loading…
Cancel
Save