2023-09-15 23:02:46 +08:00
|
|
|
#if Deprecated
|
2023-07-17 04:10:14 +08:00
|
|
|
using Godot;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2023-09-15 23:02:46 +08:00
|
|
|
using System.Text.RegularExpressions;
|
2023-07-17 04:10:14 +08:00
|
|
|
using BITKit;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
|
|
namespace BITFactory;
|
|
|
|
[GlobalClass]
|
|
|
|
public partial class IDIS_RegisterDB : FormDBProvider
|
|
|
|
{
|
|
|
|
public override void Submit(string data)
|
|
|
|
{
|
2023-09-15 23:02:46 +08:00
|
|
|
|
|
|
|
|
2023-07-17 04:10:14 +08:00
|
|
|
var jObject = JsonConvert.DeserializeObject<JObject>(data);
|
|
|
|
var handle = jObject["handle"]!.ToObject<string>();
|
|
|
|
var values = jObject["values"]!.ToObject<List<IDIS_Data>>();
|
2023-07-18 20:57:02 +08:00
|
|
|
var references = jObject["references"]!.ToObject<List<string>>();
|
|
|
|
var createUser = jObject["createUser"]!.ToObject<string>();
|
2023-09-15 23:02:46 +08:00
|
|
|
|
|
|
|
if(Regex.IsMatch(handle,IDIS_Code.AddressRegex) is false)
|
|
|
|
{
|
|
|
|
throw new InvalidOperationException("标识格式不正确");
|
|
|
|
}
|
2023-07-17 04:10:14 +08:00
|
|
|
|
2023-07-18 20:57:02 +08:00
|
|
|
IDIS_Service.Singleton.Register(handle, createUser);
|
2023-07-17 04:10:14 +08:00
|
|
|
foreach (var x in values)
|
|
|
|
{
|
|
|
|
IDIS_Service.Singleton.Register(handle,x.Name, x.Format, x.Value,x.Category);
|
|
|
|
}
|
2023-07-18 20:57:02 +08:00
|
|
|
|
|
|
|
foreach (var x in references)
|
|
|
|
{
|
|
|
|
IDIS_Service.Singleton.RegisterReference(handle,x);
|
|
|
|
}
|
2023-07-17 04:10:14 +08:00
|
|
|
}
|
|
|
|
}
|
2023-09-15 23:02:46 +08:00
|
|
|
#endif
|