This commit is contained in:
parent
eac28d17ec
commit
9025e8d602
|
@ -4,8 +4,8 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<AssemblyName>IDIS.Models</AssemblyName>
|
||||
<RootNamespace>IDIS</RootNamespace>
|
||||
<AssemblyName>CAICT.IDIS</AssemblyName>
|
||||
<RootNamespace>CAICT</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -64,6 +64,11 @@
|
|||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BITKit\BITKit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
|
||||
</Project>
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "IDIS.Model",
|
||||
"name": "cn.caict.idis",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
|
|
@ -0,0 +1,9 @@
|
|||
namespace CAICT.IDIS
|
||||
{
|
||||
|
||||
public abstract record IDIS_Config
|
||||
{
|
||||
public abstract string DataBaseName { get; }
|
||||
public abstract string ConnectionString { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b520f546a2274d4899597b762ec3cd7b
|
||||
timeCreated: 1726731567
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "cn.caict.idis",
|
||||
"displayName": "IDIS 类库与接口",
|
||||
"version": "2024.3.31",
|
||||
"unity": "2022.3",
|
||||
"description": "适用于AspNet和Unity的工业互联网标识类库",
|
||||
"license": "MIT",
|
||||
"dependencies": {}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e32e0f78278ae9d43a2e01310d047d1f
|
||||
PackageManifestImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,4 +1,4 @@
|
|||
namespace IDIS.Models
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
/// <summary>
|
||||
/// IDIS的编码常量
|
||||
|
|
|
@ -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<IDIS_IdData>();
|
||||
public virtual IDIS_IdData[] IdData { get; set; }=Array.Empty<IDIS_IdData>();
|
||||
|
||||
}
|
||||
}
|
|
@ -1,77 +1,81 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
namespace IDIS.Models
|
||||
using MemoryPack;
|
||||
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
/// <summary>
|
||||
/// IDIS 查询企业的结果
|
||||
/// </summary>
|
||||
public record IDIS_EnterpriseData
|
||||
{
|
||||
/// <summary>
|
||||
/// IDIS 查询企业的结果
|
||||
/// 前缀名称
|
||||
/// </summary>
|
||||
public record IDIS_EnterpriseData
|
||||
{
|
||||
/// <summary>
|
||||
/// 前缀名称
|
||||
/// </summary>
|
||||
[JsonProperty("prefix")]
|
||||
public string Prefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 前缀创建时间
|
||||
/// </summary>
|
||||
[JsonProperty("createDate")]
|
||||
public DateTime CreateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 前缀注册服务机构
|
||||
/// </summary>
|
||||
[JsonProperty("ghrName")]
|
||||
public string GhrName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 前缀状态
|
||||
/// </summary>
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业中文名称
|
||||
/// </summary>
|
||||
[JsonProperty("entNameCn")]
|
||||
public string EntNameCn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业官方地址
|
||||
/// </summary>
|
||||
[JsonProperty("entSite")]
|
||||
public string EntSite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业所属行业
|
||||
/// </summary>
|
||||
[JsonProperty("entIndustry")]
|
||||
public string EntIndustry { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业中文地址
|
||||
/// </summary>
|
||||
[JsonProperty("entAddrCn")]
|
||||
public string EntAddrCn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业简介
|
||||
/// </summary>
|
||||
[JsonProperty("entDesc")]
|
||||
public string EntDesc { get; set; }
|
||||
}
|
||||
[JsonProperty("prefix")]
|
||||
public string Prefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 前缀创建时间
|
||||
/// </summary>
|
||||
[JsonProperty("createDate")]
|
||||
public DateTime CreateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 前缀注册服务机构
|
||||
/// </summary>
|
||||
[JsonProperty("ghrName")]
|
||||
public string GhrName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 前缀状态
|
||||
/// </summary>
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业中文名称
|
||||
/// </summary>
|
||||
[JsonProperty("entNameCn")]
|
||||
public string EntNameCn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业官方地址
|
||||
/// </summary>
|
||||
[JsonProperty("entSite")]
|
||||
public string EntSite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业所属行业
|
||||
/// </summary>
|
||||
[JsonProperty("entIndustry")]
|
||||
public string EntIndustry { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业中文地址
|
||||
/// </summary>
|
||||
[JsonProperty("entAddrCn")]
|
||||
public string EntAddrCn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业简介
|
||||
/// </summary>
|
||||
[JsonProperty("entDesc")]
|
||||
public string EntDesc { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IDIS Enterprise class
|
||||
/// </summary>
|
||||
public record IDIS_Enterprise
|
||||
[MemoryPackable]
|
||||
public partial record IDIS_Enterprise
|
||||
{
|
||||
/// <summary>
|
||||
/// System user information
|
||||
/// </summary>
|
||||
public record SystemUserInfo
|
||||
[MemoryPackable]
|
||||
public partial record SystemUserInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// User name
|
||||
|
@ -81,6 +85,7 @@ namespace IDIS.Models
|
|||
[Key]
|
||||
#endif
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User email
|
||||
/// </summary>
|
||||
|
@ -104,39 +109,38 @@ namespace IDIS.Models
|
|||
/// </summary>
|
||||
[JsonProperty("remarks")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enterprise qualification information
|
||||
/// </summary>
|
||||
public record EnterpriseInfo
|
||||
[MemoryPackable]
|
||||
public partial record EnterpriseInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Enterprise email
|
||||
/// </summary>
|
||||
[JsonProperty("email")]
|
||||
public string EMail { get; set; }
|
||||
public virtual string EMail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enterprise detailed address
|
||||
/// </summary>
|
||||
[JsonProperty("entAddrCn")]
|
||||
public string AddressCN { get; set; }
|
||||
public virtual string AddressCN { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// City code
|
||||
/// </summary>
|
||||
[JsonProperty("entCityCode")]
|
||||
public string CityCode { get; set; }
|
||||
public virtual string CityCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// County code
|
||||
/// </summary>
|
||||
[JsonProperty("entCountyCode")]
|
||||
public string CountyCode { get; set; }
|
||||
public virtual string CountyCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Credit code
|
||||
|
@ -145,127 +149,127 @@ namespace IDIS.Models
|
|||
[Key]
|
||||
#endif
|
||||
[JsonProperty("entCrtCode")]
|
||||
public string CreditCode { get; set; }
|
||||
public virtual string CreditCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Business license image Base64 encoding
|
||||
/// </summary>
|
||||
[JsonProperty("entCrtImgContent")]
|
||||
public string CreditImageContent { get; set; }
|
||||
public virtual string CreditImageContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Business license type code
|
||||
/// </summary>
|
||||
[JsonProperty("entCrtType")]
|
||||
public CreditType CreditType { get; set; }
|
||||
public virtual CreditType CreditType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enterprise remarks
|
||||
/// </summary>
|
||||
[JsonProperty("entDesc")]
|
||||
public string Descption { get; set; }
|
||||
public virtual string Descption { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Major industry code
|
||||
/// </summary>
|
||||
[JsonProperty("entIndustry")]
|
||||
public MajorIndustryCode Industry { get; set; }
|
||||
public virtual MajorIndustryCode Industry { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enterprise name
|
||||
/// </summary>
|
||||
[JsonProperty("entNameCn")]
|
||||
public string NameCN { get; set; }
|
||||
public virtual string NameCN { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Province code
|
||||
/// </summary>
|
||||
[JsonProperty("entProvinceCode")]
|
||||
public string ProvinceCode { get; set; }
|
||||
public virtual string ProvinceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Minor industry code
|
||||
/// </summary>
|
||||
[JsonProperty("entTrade")]
|
||||
public MinorIndustryCode Trade { get; set; }
|
||||
public virtual MinorIndustryCode Trade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enterprise type code
|
||||
/// </summary>
|
||||
[JsonProperty("entType")]
|
||||
public EnterpriseTypeCode Type { get; set; }
|
||||
public virtual EnterpriseTypeCode Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enterprise website
|
||||
/// </summary>
|
||||
[JsonProperty("entWebSite")]
|
||||
public string WebSite { get; set; }
|
||||
public virtual string WebSite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Legal person ID card attachment back image Base64 encoding
|
||||
/// </summary>
|
||||
[JsonProperty("legalpIdImgBackContent")]
|
||||
public string LegalPersonIdImageBackContent { get; set; }
|
||||
public virtual string LegalPersonIdImageBackContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Legal person ID card attachment front image Base64 encoding
|
||||
/// </summary>
|
||||
[JsonProperty("legalpIdImgFrontContent")]
|
||||
public string LegalPersonIdImageFrontContent { get; set; }
|
||||
public virtual string LegalPersonIdImageFrontContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Legal person ID number
|
||||
/// </summary>
|
||||
[JsonProperty("legalpIdno")]
|
||||
public string LegalPersonIdNumber { get; set; }
|
||||
public virtual string LegalPersonIdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Legal person ID type code
|
||||
/// </summary>
|
||||
[JsonProperty("legalpIdtype")]
|
||||
public DocumentTypeCode LegalPersonIdType { get; set; }
|
||||
public virtual DocumentTypeCode LegalPersonIdType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Legal person name
|
||||
/// </summary>
|
||||
[JsonProperty("legalpName")]
|
||||
public string LegalPersonIdName { get; set; }
|
||||
public virtual string LegalPersonIdName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Contact mobile
|
||||
/// </summary>
|
||||
[JsonProperty("mobile")]
|
||||
public string Mobile { get; set; }
|
||||
public virtual string Mobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enterprise remarks
|
||||
/// </summary>
|
||||
[JsonProperty("remarks")]
|
||||
public string Remarks { get; set; }
|
||||
public virtual string Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enterprise prefix
|
||||
/// </summary>
|
||||
[JsonProperty("entPrefix")]
|
||||
public string Prefix { get; set; }
|
||||
public virtual string Prefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Contact name
|
||||
/// </summary>
|
||||
[JsonProperty("contactName")]
|
||||
public string ContactName { get; set; }
|
||||
public virtual string ContactName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户信息
|
||||
/// </summary>
|
||||
[JsonProperty("sysUser")]
|
||||
public SystemUserInfo SystemUser { get; set; } = new();
|
||||
public virtual SystemUserInfo SystemUser { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 企业资质信息
|
||||
/// </summary>
|
||||
[JsonProperty("entApply")]
|
||||
public EnterpriseInfo EnterpriseApply { get; set; } = new();
|
||||
public virtual EnterpriseInfo EnterpriseApply { get; set; } = new();
|
||||
}
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using MemoryPack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IDIS.Models
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
using MemoryPack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IDIS.Models
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
public class IDIS_ItemVOS
|
||||
{
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
|
||||
using System;
|
||||
using MemoryPack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IDIS.Models
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
public class IDIS_MetaDataInfo
|
||||
{
|
||||
|
|
|
@ -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<string>();
|
||||
// [JsonIgnore]
|
||||
// public virtual string[] Tags { get; set; } = Array.Empty<string>();
|
||||
public virtual IDIS_Register_Data.ValueInfo[] AsValueInfo()
|
||||
{
|
||||
var list = new List<IDIS_Register_Data.ValueInfo>();
|
||||
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
|
||||
|
|
|
@ -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<QueryInfo>();
|
||||
[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<QueryInfo>();
|
||||
}
|
||||
}
|
|
@ -1,11 +1,15 @@
|
|||
using System.IO;
|
||||
using BITKit;
|
||||
using MemoryPack;
|
||||
using Microsoft.SqlServer.Server;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IDIS.Models
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
/// <summary>
|
||||
/// 用于序列化的注册数据结构
|
||||
/// </summary>
|
||||
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<IDIS_Register_Data>(r.ReadString());
|
||||
BITMapper.Map(this, value);
|
||||
}
|
||||
|
||||
public void Write(BinaryWriter w)
|
||||
{
|
||||
w.Write(JsonConvert.SerializeObject(this));
|
||||
}
|
||||
public sealed class ValueInfosWriter:NetMessageReader<ValueInfo[]>
|
||||
{
|
||||
public override ValueInfo[] ReadBinary(BinaryReader reader)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<ValueInfo[]>(reader.ReadString());
|
||||
}
|
||||
|
||||
public override void WriteBinary(BinaryWriter writer, ValueInfo[] value)
|
||||
{
|
||||
writer.Write(JsonConvert.SerializeObject(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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<T>()
|
||||
{
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using MemoryPack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IDIS.Models
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
/// <summary>
|
||||
/// 标识模板
|
||||
|
@ -23,27 +24,27 @@ namespace IDIS.Models
|
|||
/// <para>必填</para>
|
||||
/// </summary>
|
||||
[JsonProperty("prefix")]
|
||||
public string Prefix { get; set; } = nameof(IDIS_Template);
|
||||
public virtual string Prefix { get; set; } = nameof(IDIS_Template);
|
||||
|
||||
/// <summary>
|
||||
/// 模板版本
|
||||
/// <para>必填</para>
|
||||
/// </summary>
|
||||
[JsonProperty("version")]
|
||||
public string Version { get; set; } = "alpha-1.0";
|
||||
public virtual string Version { get; set; } = "alpha-1.0";
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// <para>非必填</para>
|
||||
/// </summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public virtual string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 模板内容
|
||||
/// <para>必填</para>
|
||||
/// </summary>
|
||||
[JsonProperty("items")]
|
||||
public IDIS_Template_Item[] Items { get; set; } = Array.Empty<IDIS_Template_Item>();
|
||||
public virtual IDIS_Template_Item[] Items { get; set; } = Array.Empty<IDIS_Template_Item>();
|
||||
}
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using IDIS;
|
||||
using MemoryPack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IDIS.Models
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
/// <summary>
|
||||
/// 基于IDIS v1的标识模板值
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
using System;
|
||||
using MemoryPack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IDIS
|
||||
{
|
||||
|
||||
public record IDIS_Template_Item_MetaData
|
||||
{
|
||||
public IDIS_Template_Item_MetaData()
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using MemoryPack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IDIS.Models
|
||||
namespace CAICT.IDIS
|
||||
{
|
||||
public class TitleBarInfo
|
||||
{
|
||||
|
|
|
@ -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<IDIS_Enterprise.EnterpriseInfo[]> GetEnterprisesAsync();
|
||||
public UniTask<IDIS_Enterprise.SystemUserInfo[]> GetSystemUsersAsync();
|
||||
public UniTask<IDIS_EnterpriseData> GetEnterpriseAsync(string prefix);
|
||||
public UniTask<IDIS_Enterprise.SystemUserInfo> 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<IDIS_Enterprise.EnterpriseInfo[]> GetEnterprisesAsync()=> default;
|
||||
|
||||
public UniTask<IDIS_Enterprise.SystemUserInfo[]> GetSystemUsersAsync()=> default;
|
||||
|
||||
public UniTask<IDIS_EnterpriseData> GetEnterpriseAsync(string prefix)=> default;
|
||||
|
||||
public UniTask<IDIS_Enterprise.SystemUserInfo> GetSystemUserAsync(string userName)=> default;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 标识解析节点的接口定义,包括了:增删改查,连接状态的回调
|
||||
|
@ -41,7 +43,7 @@ namespace IDIS.Services
|
|||
/// <param name="handle">标识码</param>
|
||||
/// <param name="templateVersion">标识模板</param>
|
||||
/// <param name="value">值,通常为字典</param>
|
||||
UniTask RegisterAsync(string handle, string templateVersion,IDIS_Register_Data.ValueInfo[] value);
|
||||
UniTask RegisterIDISAsync(string handle, string templateVersion,IDIS_Register_Data.ValueInfo[] value);
|
||||
|
||||
/// <summary>
|
||||
/// 异步删除标识
|
||||
|
@ -86,4 +88,29 @@ namespace IDIS.Services
|
|||
/// <returns>是否已注册</returns>
|
||||
UniTask<bool> 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<string> OnConnectFailure;
|
||||
public event Action OnDisconnected;
|
||||
public event Action<IDIS_Query_Data> OnQuery;
|
||||
public event Action<string, string> 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<string, object> value) => default;
|
||||
public UniTask<IDIS_Query_Data> QueryAsync(string code) => default;
|
||||
public UniTask<IDIS_Query_Data[]> ToArrayAsync() => default;
|
||||
public UniTask<bool> IsExistAsync(string code) => default;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 标识模板服务
|
||||
|
@ -40,4 +41,22 @@ namespace IDIS.Services
|
|||
/// <param name="version"></param>
|
||||
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<IDIS_Template>? OnTemplateCreated;
|
||||
public event Action<IDIS_Template>? OnTemplateDeleted;
|
||||
public UniTask<IDIS_Template> QueryAsync(string prefix, string version)=> default;
|
||||
public UniTask<IDIS_Template[]> ToArrayAsync()=> default;
|
||||
public UniTask SaveAsync(IDIS_Template template)=> default;
|
||||
|
||||
public UniTask DeleteAsync(string prefix, string version)=> default;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue