diff --git a/IDIS_Models.csproj b/CN.CAICT.IDIS.csproj similarity index 92% rename from IDIS_Models.csproj rename to CN.CAICT.IDIS.csproj index 92c68e7..dcf56cf 100644 --- a/IDIS_Models.csproj +++ b/CN.CAICT.IDIS.csproj @@ -4,8 +4,8 @@ enable enable net7.0 - IDIS.Models - IDIS + CAICT.IDIS + CAICT @@ -64,6 +64,11 @@ + + + + + diff --git a/src/IDIS.Model.asmdef b/Src/CN.CAICT.IDIS.asmdef similarity index 93% rename from src/IDIS.Model.asmdef rename to Src/CN.CAICT.IDIS.asmdef index bb99bec..aada252 100644 --- a/src/IDIS.Model.asmdef +++ b/Src/CN.CAICT.IDIS.asmdef @@ -1,5 +1,5 @@ { - "name": "IDIS.Model", + "name": "cn.caict.idis", "rootNamespace": "", "references": [ "GUID:14fe60d984bf9f84eac55c6ea033a8f4", diff --git a/src/IDIS.Model.asmdef.meta b/Src/CN.CAICT.IDIS.asmdef.meta similarity index 100% rename from src/IDIS.Model.asmdef.meta rename to Src/CN.CAICT.IDIS.asmdef.meta diff --git a/Src/Models/IDIS_Config.cs b/Src/Models/IDIS_Config.cs new file mode 100644 index 0000000..f79d809 --- /dev/null +++ b/Src/Models/IDIS_Config.cs @@ -0,0 +1,9 @@ +namespace CAICT.IDIS +{ + + public abstract record IDIS_Config + { + public abstract string DataBaseName { get; } + public abstract string ConnectionString { get; } + } +} \ No newline at end of file diff --git a/Src/Models/IDIS_Config.cs.meta b/Src/Models/IDIS_Config.cs.meta new file mode 100644 index 0000000..e2808c6 --- /dev/null +++ b/Src/Models/IDIS_Config.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b520f546a2274d4899597b762ec3cd7b +timeCreated: 1726731567 \ No newline at end of file diff --git a/Src/package.json b/Src/package.json new file mode 100644 index 0000000..a08c9da --- /dev/null +++ b/Src/package.json @@ -0,0 +1,9 @@ +{ + "name": "cn.caict.idis", + "displayName": "IDIS 类库与接口", + "version": "2024.3.31", + "unity": "2022.3", + "description": "适用于AspNet和Unity的工业互联网标识类库", + "license": "MIT", + "dependencies": {} +} \ No newline at end of file diff --git a/Src/package.json.meta b/Src/package.json.meta new file mode 100644 index 0000000..e1cd4e5 --- /dev/null +++ b/Src/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e32e0f78278ae9d43a2e01310d047d1f +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Models/IDIS_Code.cs b/src/Models/IDIS_Code.cs index d3c3239..fd8dc08 100644 --- a/src/Models/IDIS_Code.cs +++ b/src/Models/IDIS_Code.cs @@ -1,4 +1,4 @@ -namespace IDIS.Models +namespace CAICT.IDIS { /// /// IDIS的编码常量 diff --git a/src/Models/IDIS_Data.cs b/src/Models/IDIS_Data.cs index be44991..cbad7b0 100644 --- a/src/Models/IDIS_Data.cs +++ b/src/Models/IDIS_Data.cs @@ -1,26 +1,26 @@ using System; +using MemoryPack; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { - public record IDIS_Data { [JsonProperty("prefixType")] - public int PrefixType { get; set; } + public virtual int PrefixType { get; set; } [JsonProperty("metaDataInfo")] - public IDIS_MetaDataInfo MetaDataInfo { get; set; } = new(); + public virtual IDIS_MetaDataInfo MetaDataInfo { get; set; } = new(); [JsonProperty("pmsReg")] - public bool PmsReg { get; set; } + public virtual bool PmsReg { get; set; } [JsonProperty("titleBarInfo")] - public TitleBarInfo TitleBarInfo { get; set; } = new(); + public virtual TitleBarInfo TitleBarInfo { get; set; } = new(); [JsonProperty("IdData")] - public IDIS_IdData[] IdData { get; set; }=Array.Empty(); + public virtual IDIS_IdData[] IdData { get; set; }=Array.Empty(); } } \ No newline at end of file diff --git a/src/Models/IDIS_Enterprise.cs b/src/Models/IDIS_Enterprise.cs index 1f4d54a..03dfe58 100644 --- a/src/Models/IDIS_Enterprise.cs +++ b/src/Models/IDIS_Enterprise.cs @@ -1,77 +1,81 @@ using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; using System; -namespace IDIS.Models +using MemoryPack; + +namespace CAICT.IDIS { + /// + /// IDIS 查询企业的结果 + /// + public record IDIS_EnterpriseData + { /// - /// IDIS 查询企业的结果 + /// 前缀名称 /// - public record IDIS_EnterpriseData - { - /// - /// 前缀名称 - /// - [JsonProperty("prefix")] - public string Prefix { get; set; } - - /// - /// 前缀创建时间 - /// - [JsonProperty("createDate")] - public DateTime CreateDate { get; set; } - - /// - /// 前缀注册服务机构 - /// - [JsonProperty("ghrName")] - public string GhrName { get; set; } - - /// - /// 前缀状态 - /// - [JsonProperty("status")] - public int Status { get; set; } - - /// - /// 企业中文名称 - /// - [JsonProperty("entNameCn")] - public string EntNameCn { get; set; } - - /// - /// 企业官方地址 - /// - [JsonProperty("entSite")] - public string EntSite { get; set; } - - /// - /// 企业所属行业 - /// - [JsonProperty("entIndustry")] - public string EntIndustry { get; set; } - - /// - /// 企业中文地址 - /// - [JsonProperty("entAddrCn")] - public string EntAddrCn { get; set; } - - /// - /// 企业简介 - /// - [JsonProperty("entDesc")] - public string EntDesc { get; set; } - } + [JsonProperty("prefix")] + public string Prefix { get; set; } /// + /// 前缀创建时间 + /// + [JsonProperty("createDate")] + public DateTime CreateDate { get; set; } + + /// + /// 前缀注册服务机构 + /// + [JsonProperty("ghrName")] + public string GhrName { get; set; } + + /// + /// 前缀状态 + /// + [JsonProperty("status")] + public int Status { get; set; } + + /// + /// 企业中文名称 + /// + [JsonProperty("entNameCn")] + public string EntNameCn { get; set; } + + /// + /// 企业官方地址 + /// + [JsonProperty("entSite")] + public string EntSite { get; set; } + + /// + /// 企业所属行业 + /// + [JsonProperty("entIndustry")] + public string EntIndustry { get; set; } + + /// + /// 企业中文地址 + /// + [JsonProperty("entAddrCn")] + public string EntAddrCn { get; set; } + + /// + /// 企业简介 + /// + [JsonProperty("entDesc")] + public string EntDesc { get; set; } + } + + /// /// IDIS Enterprise class /// - public record IDIS_Enterprise + [MemoryPackable] + public partial record IDIS_Enterprise { /// /// System user information /// - public record SystemUserInfo + [MemoryPackable] + public partial record SystemUserInfo { /// /// User name @@ -81,6 +85,7 @@ namespace IDIS.Models [Key] #endif public string UserName { get; set; } + /// /// User email /// @@ -104,39 +109,38 @@ namespace IDIS.Models /// [JsonProperty("remarks")] public string Remark { get; set; } - - } /// /// Enterprise qualification information /// - public record EnterpriseInfo + [MemoryPackable] + public partial record EnterpriseInfo { /// /// Enterprise email /// [JsonProperty("email")] - public string EMail { get; set; } + public virtual string EMail { get; set; } /// /// Enterprise detailed address /// [JsonProperty("entAddrCn")] - public string AddressCN { get; set; } + public virtual string AddressCN { get; set; } /// /// City code /// [JsonProperty("entCityCode")] - public string CityCode { get; set; } + public virtual string CityCode { get; set; } + - /// /// County code /// [JsonProperty("entCountyCode")] - public string CountyCode { get; set; } + public virtual string CountyCode { get; set; } /// /// Credit code @@ -145,127 +149,127 @@ namespace IDIS.Models [Key] #endif [JsonProperty("entCrtCode")] - public string CreditCode { get; set; } + public virtual string CreditCode { get; set; } /// /// Business license image Base64 encoding /// [JsonProperty("entCrtImgContent")] - public string CreditImageContent { get; set; } + public virtual string CreditImageContent { get; set; } /// /// Business license type code /// [JsonProperty("entCrtType")] - public CreditType CreditType { get; set; } + public virtual CreditType CreditType { get; set; } /// /// Enterprise remarks /// [JsonProperty("entDesc")] - public string Descption { get; set; } + public virtual string Descption { get; set; } /// /// Major industry code /// [JsonProperty("entIndustry")] - public MajorIndustryCode Industry { get; set; } + public virtual MajorIndustryCode Industry { get; set; } /// /// Enterprise name /// [JsonProperty("entNameCn")] - public string NameCN { get; set; } + public virtual string NameCN { get; set; } /// /// Province code /// [JsonProperty("entProvinceCode")] - public string ProvinceCode { get; set; } + public virtual string ProvinceCode { get; set; } /// /// Minor industry code /// [JsonProperty("entTrade")] - public MinorIndustryCode Trade { get; set; } + public virtual MinorIndustryCode Trade { get; set; } /// /// Enterprise type code /// [JsonProperty("entType")] - public EnterpriseTypeCode Type { get; set; } + public virtual EnterpriseTypeCode Type { get; set; } /// /// Enterprise website /// [JsonProperty("entWebSite")] - public string WebSite { get; set; } + public virtual string WebSite { get; set; } /// /// Legal person ID card attachment back image Base64 encoding /// [JsonProperty("legalpIdImgBackContent")] - public string LegalPersonIdImageBackContent { get; set; } + public virtual string LegalPersonIdImageBackContent { get; set; } /// /// Legal person ID card attachment front image Base64 encoding /// [JsonProperty("legalpIdImgFrontContent")] - public string LegalPersonIdImageFrontContent { get; set; } + public virtual string LegalPersonIdImageFrontContent { get; set; } /// /// Legal person ID number /// [JsonProperty("legalpIdno")] - public string LegalPersonIdNumber { get; set; } + public virtual string LegalPersonIdNumber { get; set; } /// /// Legal person ID type code /// [JsonProperty("legalpIdtype")] - public DocumentTypeCode LegalPersonIdType { get; set; } + public virtual DocumentTypeCode LegalPersonIdType { get; set; } /// /// Legal person name /// [JsonProperty("legalpName")] - public string LegalPersonIdName { get; set; } + public virtual string LegalPersonIdName { get; set; } /// /// Contact mobile /// [JsonProperty("mobile")] - public string Mobile { get; set; } + public virtual string Mobile { get; set; } /// /// Enterprise remarks /// [JsonProperty("remarks")] - public string Remarks { get; set; } + public virtual string Remarks { get; set; } /// /// Enterprise prefix /// [JsonProperty("entPrefix")] - public string Prefix { get; set; } + public virtual string Prefix { get; set; } /// /// Contact name /// [JsonProperty("contactName")] - public string ContactName { get; set; } + public virtual string ContactName { get; set; } } /// /// 用户信息 /// [JsonProperty("sysUser")] - public SystemUserInfo SystemUser { get; set; } = new(); - + public virtual SystemUserInfo SystemUser { get; set; } = new(); + /// /// 企业资质信息 /// [JsonProperty("entApply")] - public EnterpriseInfo EnterpriseApply { get; set; } = new(); + public virtual EnterpriseInfo EnterpriseApply { get; set; } = new(); } } \ No newline at end of file diff --git a/src/Models/IDIS_IdData.cs b/src/Models/IDIS_IdData.cs index c759332..5e0124e 100644 --- a/src/Models/IDIS_IdData.cs +++ b/src/Models/IDIS_IdData.cs @@ -1,8 +1,9 @@ using System; using System.ComponentModel.DataAnnotations; +using MemoryPack; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { /// diff --git a/src/Models/IDIS_ItemVOS.cs b/src/Models/IDIS_ItemVOS.cs index b0b1763..d4ef0a2 100644 --- a/src/Models/IDIS_ItemVOS.cs +++ b/src/Models/IDIS_ItemVOS.cs @@ -1,7 +1,8 @@ +using MemoryPack; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { public class IDIS_ItemVOS { diff --git a/src/Models/IDIS_MetaDataInfo.cs b/src/Models/IDIS_MetaDataInfo.cs index eb0a00d..1d5ef3c 100644 --- a/src/Models/IDIS_MetaDataInfo.cs +++ b/src/Models/IDIS_MetaDataInfo.cs @@ -1,8 +1,9 @@ using System; +using MemoryPack; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { public class IDIS_MetaDataInfo { diff --git a/src/Models/IDIS_Model.cs b/src/Models/IDIS_Model.cs index 93a46d6..d126f30 100644 --- a/src/Models/IDIS_Model.cs +++ b/src/Models/IDIS_Model.cs @@ -3,29 +3,30 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; -using IDIS.Models; +using CAICT.IDIS; +using MemoryPack; using Newtonsoft.Json; namespace IDIS.Model { public record IDIS_Model { - [JsonIgnore] - public virtual string[] Tags { get; set; } = Array.Empty(); + // [JsonIgnore] + // public virtual string[] Tags { get; set; } = Array.Empty(); public virtual IDIS_Register_Data.ValueInfo[] AsValueInfo() { var list = new List(); - list.Add(new IDIS_Register_Data.ValueInfo - { - Data = new IDIS_Register_Data.ValueData - { - Value = string.Join(";",Tags), - Format = "string" - }, - Index = 0, - Type = "Tags" - }); - var index = 1; + // list.Add(new IDIS_Register_Data.ValueInfo + // { + // Data = new IDIS_Register_Data.ValueData + // { + // Value = string.Join(";",Tags), + // Format = "string" + // }, + // Index = 0, + // Type = "Tags" + // }); + var index = 0; foreach (var x in GetProperties()) { var valueInfo = new IDIS_Register_Data.ValueInfo diff --git a/src/Models/IDIS_Query_Data.cs b/src/Models/IDIS_Query_Data.cs index 832d110..4b65275 100644 --- a/src/Models/IDIS_Query_Data.cs +++ b/src/Models/IDIS_Query_Data.cs @@ -1,39 +1,31 @@ using System; +using System.IO; +using BITKit; +using MemoryPack; +using Microsoft.SqlServer.Server; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { [Serializable] public record IDIS_Query_Data { - public record QueryData { - [JsonProperty("format")] - public string Format; - [JsonProperty("value")] - public string Value; + [JsonProperty("format")] public string Format; + [JsonProperty("value")] public string Value; } public record QueryInfo { - [JsonProperty("data")] - public QueryData Data; - [JsonProperty("auth")] - public string Auth; - [JsonProperty("index")] - public int Index; - [JsonProperty("type")] - public string Type; + [JsonProperty("data")] public QueryData Data; + [JsonProperty("auth")] public string Auth; + [JsonProperty("index")] public int Index; + [JsonProperty("type")] public string Type; } - [JsonProperty("code")] - public int Code; - [JsonProperty("prefix")] - public string Prefix; - [JsonProperty("handle")] - public string Handle; - [JsonProperty("templateVersion")] - public string TemplateVersion; - [JsonProperty("value")] - public QueryInfo[] Value=Array.Empty(); + [JsonProperty("code")] public virtual int Code { get; set; } + [JsonProperty("prefix")] public virtual string Prefix { get; set; } + [JsonProperty("handle")] public virtual string Handle { get; set; } + [JsonProperty("templateVersion")] public virtual string TemplateVersion { get; set; } + [JsonProperty("value")] public virtual QueryInfo[] Value { get; set; } = Array.Empty(); } } \ No newline at end of file diff --git a/src/Models/IDIS_Register_Data.cs b/src/Models/IDIS_Register_Data.cs index 131ca71..6f3213a 100644 --- a/src/Models/IDIS_Register_Data.cs +++ b/src/Models/IDIS_Register_Data.cs @@ -1,11 +1,15 @@ +using System.IO; +using BITKit; +using MemoryPack; +using Microsoft.SqlServer.Server; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { /// /// 用于序列化的注册数据结构 /// - public class IDIS_Register_Data + public record IDIS_Register_Data:IBinarySerialize { public record ValueData { @@ -13,7 +17,6 @@ namespace IDIS.Models public string Format; [JsonProperty("value")] public string Value; - } public record ValueInfo { @@ -28,10 +31,35 @@ namespace IDIS.Models } [JsonProperty("handle")] - public string Handle; + public string Handle { get; set; } [JsonProperty("templateVersion")] - public string TemplateVersion; + public string TemplateVersion { get; set; } [JsonProperty("value")] - public ValueInfo[] Value; + public ValueInfo[] Value { get; set; } + + public void Read(BinaryReader r) + { + + var value = JsonConvert.DeserializeObject(r.ReadString()); + BITMapper.Map(this, value); + } + + public void Write(BinaryWriter w) + { + w.Write(JsonConvert.SerializeObject(this)); + } + public sealed class ValueInfosWriter:NetMessageReader + { + public override ValueInfo[] ReadBinary(BinaryReader reader) + { + return JsonConvert.DeserializeObject(reader.ReadString()); + } + + public override void WriteBinary(BinaryWriter writer, ValueInfo[] value) + { + writer.Write(JsonConvert.SerializeObject(value)); + } + } } + } \ No newline at end of file diff --git a/src/Models/IDIS_Response.cs b/src/Models/IDIS_Response.cs index a0ca49f..9bcd9f8 100644 --- a/src/Models/IDIS_Response.cs +++ b/src/Models/IDIS_Response.cs @@ -1,5 +1,6 @@ using System; -using IDIS.Models; +using CAICT.IDIS; +using MemoryPack; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -75,9 +76,12 @@ namespace IDIS public int Status { get; set; } = 1; [JsonProperty("data")] + [MemoryPackIgnore] public object Data { get; set; } = true; - [JsonIgnore] private JObject jObject; + [JsonIgnore] + [MemoryPackIgnore] + private JObject jObject; public T As() { diff --git a/src/Models/IDIS_Template.cs b/src/Models/IDIS_Template.cs index 4965465..a64cfce 100644 --- a/src/Models/IDIS_Template.cs +++ b/src/Models/IDIS_Template.cs @@ -1,7 +1,8 @@ using System; +using MemoryPack; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { /// /// 标识模板 @@ -23,27 +24,27 @@ namespace IDIS.Models /// 必填 /// [JsonProperty("prefix")] - public string Prefix { get; set; } = nameof(IDIS_Template); + public virtual string Prefix { get; set; } = nameof(IDIS_Template); /// /// 模板版本 /// 必填 /// [JsonProperty("version")] - public string Version { get; set; } = "alpha-1.0"; + public virtual string Version { get; set; } = "alpha-1.0"; /// /// 描述 /// 非必填 /// [JsonProperty("description")] - public string Description { get; set; } = string.Empty; + public virtual string Description { get; set; } = string.Empty; /// /// 模板内容 /// 必填 /// [JsonProperty("items")] - public IDIS_Template_Item[] Items { get; set; } = Array.Empty(); + public virtual IDIS_Template_Item[] Items { get; set; } = Array.Empty(); } } \ No newline at end of file diff --git a/src/Models/IDIS_Template_Item.cs b/src/Models/IDIS_Template_Item.cs index 6a185a6..f15374e 100644 --- a/src/Models/IDIS_Template_Item.cs +++ b/src/Models/IDIS_Template_Item.cs @@ -1,7 +1,9 @@ using System; +using IDIS; +using MemoryPack; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { /// /// 基于IDIS v1的标识模板值 diff --git a/src/Models/IDIS_Template_Item_MetaData.cs b/src/Models/IDIS_Template_Item_MetaData.cs index 52dc1f1..ac8ff0b 100644 --- a/src/Models/IDIS_Template_Item_MetaData.cs +++ b/src/Models/IDIS_Template_Item_MetaData.cs @@ -1,9 +1,9 @@ using System; +using MemoryPack; using Newtonsoft.Json; namespace IDIS { - public record IDIS_Template_Item_MetaData { public IDIS_Template_Item_MetaData() diff --git a/src/Models/IDIS_TitleBarInfo.cs b/src/Models/IDIS_TitleBarInfo.cs index a0fe97b..b147d53 100644 --- a/src/Models/IDIS_TitleBarInfo.cs +++ b/src/Models/IDIS_TitleBarInfo.cs @@ -1,7 +1,8 @@ using System; +using MemoryPack; using Newtonsoft.Json; -namespace IDIS.Models +namespace CAICT.IDIS { public class TitleBarInfo { diff --git a/src/Services/IDIS_EnterpriseService.cs b/src/Services/IDIS_EnterpriseService.cs index 2ee4921..ef1e06e 100644 --- a/src/Services/IDIS_EnterpriseService.cs +++ b/src/Services/IDIS_EnterpriseService.cs @@ -1,13 +1,38 @@ +using BITKit; using Cysharp.Threading.Tasks; -namespace IDIS.Models +namespace CAICT.IDIS.Service { public interface IDIS_EnterpriseService { - public UniTask RegisterAsync(IDIS_Enterprise.SystemUserInfo userInfo, IDIS_Enterprise.EnterpriseInfo enterpriseInfo); + public UniTask RegisterAsync(IDIS_Enterprise.SystemUserInfo userInfo, + IDIS_Enterprise.EnterpriseInfo enterpriseInfo); + public UniTask GetEnterprisesAsync(); public UniTask GetSystemUsersAsync(); public UniTask GetEnterpriseAsync(string prefix); public UniTask GetSystemUserAsync(string userName); } + + public class NetIDIS_EnterpriseService:IDIS_EnterpriseService + { + protected INetProvider NetProvider { get; set; } + public NetIDIS_EnterpriseService(INetProvider netProvider) + { + NetProvider = netProvider; + } + public NetIDIS_EnterpriseService() + { + + } + public UniTask RegisterAsync(IDIS_Enterprise.SystemUserInfo userInfo, IDIS_Enterprise.EnterpriseInfo enterpriseInfo)=> default; + + public UniTask GetEnterprisesAsync()=> default; + + public UniTask GetSystemUsersAsync()=> default; + + public UniTask GetEnterpriseAsync(string prefix)=> default; + + public UniTask GetSystemUserAsync(string userName)=> default; + } } \ No newline at end of file diff --git a/src/Services/IDIS_Service.cs b/src/Services/IDIS_Service.cs index c76bc4e..4047146 100644 --- a/src/Services/IDIS_Service.cs +++ b/src/Services/IDIS_Service.cs @@ -1,9 +1,11 @@ using System; using System.Collections.Generic; +using BITKit; using Cysharp.Threading.Tasks; -using IDIS.Models; +using CAICT.IDIS; +using IDIS; -namespace IDIS.Services +namespace CAICT.IDIS.Service { /// /// 标识解析节点的接口定义,包括了:增删改查,连接状态的回调 @@ -41,7 +43,7 @@ namespace IDIS.Services /// 标识码 /// 标识模板 /// 值,通常为字典 - UniTask RegisterAsync(string handle, string templateVersion,IDIS_Register_Data.ValueInfo[] value); + UniTask RegisterIDISAsync(string handle, string templateVersion,IDIS_Register_Data.ValueInfo[] value); /// /// 异步删除标识 @@ -86,4 +88,29 @@ namespace IDIS.Services /// 是否已注册 UniTask IsExistAsync(string code); } + public class NetIDIS_Service:IDIS_Service + { + private readonly INetProvider _netProvider; + + public NetIDIS_Service(INetProvider netProvider) + { + _netProvider = netProvider; + } + + public event Action OnConnected; + public event Action OnConnectFailure; + public event Action OnDisconnected; + public event Action OnQuery; + public event Action OnRegister; + + public UniTask RegisterIDISAsync(string handle, string templateVersion, IDIS_Register_Data.ValueInfo[] value) => + default; + + public UniTask DeleteAsync(string code) => default; + public UniTask DeleteIdDataAsync(string code, int index) => default; + public UniTask UpdateAsync(string code, IDictionary value) => default; + public UniTask QueryAsync(string code) => default; + public UniTask ToArrayAsync() => default; + public UniTask IsExistAsync(string code) => default; + } } \ No newline at end of file diff --git a/src/Services/IDIS_TemplateService.cs b/src/Services/IDIS_TemplateService.cs index 8d756e9..bb4ee86 100644 --- a/src/Services/IDIS_TemplateService.cs +++ b/src/Services/IDIS_TemplateService.cs @@ -1,8 +1,9 @@ using System; +using BITKit; using Cysharp.Threading.Tasks; -using IDIS.Models; +using CAICT.IDIS; -namespace IDIS.Services +namespace CAICT.IDIS.Service { /// /// 标识模板服务 @@ -40,4 +41,22 @@ namespace IDIS.Services /// UniTask DeleteAsync (string prefix, string version); } + + public class NetIDIS_TemplateService:IDIS_TemplateService + { + protected readonly INetProvider NetProvider; + + public NetIDIS_TemplateService(INetProvider netProvider) + { + NetProvider = netProvider; + } + + public event Action? OnTemplateCreated; + public event Action? OnTemplateDeleted; + public UniTask QueryAsync(string prefix, string version)=> default; + public UniTask ToArrayAsync()=> default; + public UniTask SaveAsync(IDIS_Template template)=> default; + + public UniTask DeleteAsync(string prefix, string version)=> default; + } } \ No newline at end of file