From 68ad13af77c260c282ca4578538e6a72f95b4ad6 Mon Sep 17 00:00:00 2001
From: ChenYi <296215406@outlook.com>
Date: Wed, 31 Dec 2025 16:46:36 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=9B=BA=E4=BB=B6=E5=92=8C?=
=?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=8C=87=E4=BB=A4=E5=B0=81=E8=A3=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Dto/DeviceUpgradeForApiInput.cs | 5 +
.../DeviceAggregationService.cs | 71 +-
... 20251231054101_InitialCreate.Designer.cs} | 55 +-
...ate.cs => 20251231054101_InitialCreate.cs} | 34 +-
.../20251231074453_update20251231.Designer.cs | 4145 +++++++++++++++++
.../20251231074453_update20251231.cs | 32 +
.../Migrations/IoTDbContextModelSnapshot.cs | 59 +-
.../DeviceAggregationController.cs | 2 +
8 files changed, 4342 insertions(+), 61 deletions(-)
rename src/JiShe.IoT.EntityFrameworkCore/Migrations/{20251229083115_InitialCreate.Designer.cs => 20251231054101_InitialCreate.Designer.cs} (98%)
rename src/JiShe.IoT.EntityFrameworkCore/Migrations/{20251229083115_InitialCreate.cs => 20251231054101_InitialCreate.cs} (99%)
create mode 100644 src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231074453_update20251231.Designer.cs
create mode 100644 src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231074453_update20251231.cs
diff --git a/src/JiShe.IoT.Application.Contracts/DeviceAggregation/Dto/DeviceUpgradeForApiInput.cs b/src/JiShe.IoT.Application.Contracts/DeviceAggregation/Dto/DeviceUpgradeForApiInput.cs
index 7b3663f..75ecc8f 100644
--- a/src/JiShe.IoT.Application.Contracts/DeviceAggregation/Dto/DeviceUpgradeForApiInput.cs
+++ b/src/JiShe.IoT.Application.Contracts/DeviceAggregation/Dto/DeviceUpgradeForApiInput.cs
@@ -27,5 +27,10 @@ namespace JiShe.IoT.DeviceAggregation
[Required]
public Guid NowFirmwareVersionDataId { get; set; }
+ ///
+ /// 升级描述
+ ///
+ public string UpgradeDescription { get; set; }
+
}
}
\ No newline at end of file
diff --git a/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs b/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs
index 93d08ff..0aed703 100644
--- a/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs
+++ b/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs
@@ -8,11 +8,13 @@ using JiShe.ServicePro.DeviceManagement.DeviceInfos.Dto;
using JiShe.ServicePro.DeviceManagement.Permissions;
using JiShe.ServicePro.DeviceManagement.ThingModels;
using JiShe.ServicePro.Dto;
+using JiShe.ServicePro.Encrypt;
using JiShe.ServicePro.Enums;
using JiShe.ServicePro.FileManagement.Files;
using JiShe.ServicePro.FreeRedisProvider;
using JiShe.ServicePro.IoTDBManagement.DataChannels;
using JiShe.ServicePro.IoTDBManagement.TableModels;
+using JiShe.ServicePro.OneNET.Provider.OpenApiModels.Commands;
using JiShe.ServicePro.OneNETManagement.OneNETDevices;
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
using Mapster;
@@ -38,9 +40,11 @@ namespace JiShe.IoT.DeviceAggregation
/// 设备固件服务
/// 设备升级记录服务
/// 文件管理服务
- public class DeviceAggregationService(ILogger logger, IDeviceAppService deviceAppService, IOneNETDeviceService oneNETDeviceService, IReliableRedisPubSubService redisPubSubService, IIoTDBDataChannelManageService ioTDBDataChannelManageService, IOptions _ioTDBOptions, IOneNETProductService oneNETProductService, IDeviceThingModelManagementAppService deviceThingModelService, IIoTPlatformThingModelInfoAppService platformThingModelInfoAppService, IDeviceFirmwareInfoService deviceFirmwareInfoService, IDeviceUpgradeRecordService deviceUpgradeRecordService,IFileAppService fileAppService) : IoTAppService, IDeviceAggregationService
+ /// 应用服务配置
+ public class DeviceAggregationService(ILogger logger, IDeviceAppService deviceAppService, IOneNETDeviceService oneNETDeviceService, IReliableRedisPubSubService redisPubSubService, IIoTDBDataChannelManageService ioTDBDataChannelManageService, IOptions _ioTDBOptions, IOptions _serverOptions, IOneNETProductService oneNETProductService, IDeviceThingModelManagementAppService deviceThingModelService, IIoTPlatformThingModelInfoAppService platformThingModelInfoAppService, IDeviceFirmwareInfoService deviceFirmwareInfoService, IDeviceUpgradeRecordService deviceUpgradeRecordService, IFileAppService fileAppService) : IoTAppService, IDeviceAggregationService
{
IoTDBOptions ioTDBOptions = _ioTDBOptions.Value;
+ ServerApplicationOptions serverApplicationOptions = _serverOptions.Value;
///
@@ -354,7 +358,7 @@ namespace JiShe.IoT.DeviceAggregation
var deviceInfo = await deviceAppService.FindByIdAsync(input);
if (deviceInfo == null)
{
- throw new UserFriendlyException($"设备不存在");
+ throw new UserFriendlyException($"设备{input.Id}不存在");
}
//将指令存储
@@ -369,13 +373,22 @@ namespace JiShe.IoT.DeviceAggregation
//固件信息
var deviceFirmwareVersionInfo = await deviceFirmwareInfoService.FindByIdAsync(new IdInput() { Id = input.NowFirmwareVersionDataId });
- var fileInfo = await fileAppService.DeleteAsync(new IdInput() { Id = fileInfo.Id });
+ if (deviceFirmwareVersionInfo == null)
+ {
+ throw new UserFriendlyException($"产品Id{input.IoTPlatformProductId}的新固件信息{input.NowFirmwareVersionDataId}不存在");
+ }
+ var fileInfo = await fileAppService.GetFileAsync(new IdInput() { Id = deviceFirmwareVersionInfo.FirmwareFileId });
+
+ if (fileInfo == null)
+ {
+ throw new UserFriendlyException($"产品Id{input.IoTPlatformProductId}的新固件信息{deviceFirmwareVersionInfo.FirmwareFileName}固件文件不存在");
+ }
//数据写入遥测任务数据存储通道
if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.OneNET)
{
- return await DeviceUpgradeCommandToOneNET(deviceInfo, receiveCommandInfoDto, deviceFirmwareVersionInfo);
+ return await DeviceUpgradeCommandToOneNET(deviceInfo, receiveCommandInfoDto, deviceFirmwareVersionInfo, fileInfo,input);
}
else if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.CTWing)
{
@@ -822,22 +835,32 @@ namespace JiShe.IoT.DeviceAggregation
/// 发送OneNET平台设备升级指令
///
///
- ///
+ /// 设置属性请求内容相关
/// 固件数据Id
+ /// 固件文件信息
+ /// 入参
///
///
- protected async Task DeviceUpgradeCommandToOneNET(DeviceManagementInfoDto deviceInfo, ReceiveCommandInfoDto input, DeviceFirmwareInfoDto deviceFirmwareInfo)
+ protected async Task DeviceUpgradeCommandToOneNET(DeviceManagementInfoDto deviceInfo, ReceiveCommandInfoDto taskInput, DeviceFirmwareInfoDto deviceFirmwareInfo, FileObjectDto fileObject, DeviceUpgradeForApiInput input)
{
try
{
- if (deviceInfo == null || deviceFirmwareInfo == null)
+ if (deviceInfo == null || deviceFirmwareInfo == null || fileObject == null)
{
throw new UserFriendlyException($"{nameof(DeviceUpgradeCommandToOneNET)}设备或固件信息不能为空");
}
- if (deviceInfo.IoTPlatformProductId != deviceFirmwareInfo.IoTPlatformProductId)
+ if ((deviceInfo.IoTPlatformProductId != deviceFirmwareInfo.IoTPlatformProductId) || (deviceInfo.IoTPlatform != deviceFirmwareInfo.IoTPlatform))
{
- throw new UserFriendlyException($"设备{deviceInfo.DeviceAddress}平台产品Id固件信息中不一致");
+ throw new UserFriendlyException($"设备{deviceInfo.DeviceAddress}平台产品信息固件中不一致");
+ }
+
+ //获取设备对应的产品信息
+ var productInfo = await oneNETProductService.GetProductInfoAsync(new IdInput() { Id = deviceInfo.IoTPlatformProductId });
+
+ if (productInfo == null)
+ {
+ throw new UserFriendlyException($"{nameof(DeviceUpgradeCommandToOneNET)} OneNET设备升级属性设置失败,产品Id{deviceInfo.IoTPlatformProductId}未找到对应的产品信息。");
}
//获取设备对应的平台端物模型信息,校验前端传入的属性标识集合是否存在不合法的属性标识符
@@ -864,15 +887,41 @@ namespace JiShe.IoT.DeviceAggregation
NowFirmwareVersion = deviceFirmwareInfo.FirmwareVersion,
UpgradeSource = DeviceUpgradeSourceTypeEnum.AdminSystem,
UpgradeIdentifier = Yitter.IdGenerator.YitIdHelper.NextId(),
+ UpgradeDescription = input.UpgradeDescription,
};
+ var md5HashRaw = $"{fileObject.Md5Hash}{productInfo.ProductAccesskey}{upgradeRecordInput.UpgradeIdentifier}{fileObject.FileSize}";
+
+ var upgradeRequest = new DeviceUpgradeCommandRequest()
+ {
+ Length = fileObject.FileSize,
+ UpgradeIdentifier = upgradeRecordInput.UpgradeIdentifier,
+ SignatureValue = md5HashRaw.Md5Fun(),
+ FirmwareUrl = $"{serverApplicationOptions.DownloadDeviceFirmwareBasicUrl}",
+ TimeOut = serverApplicationOptions.DownloadDeviceFirmwareTimeOut,
+ };
+
+ upgradeRecordInput.UpgradeMessage = upgradeRequest.Serialize();
+ upgradeRecordInput.FirmwareSignature = upgradeRequest.SignatureValue;
+
var insertResult = await deviceUpgradeRecordService.CreateAsync(upgradeRecordInput);
+ if (insertResult == null)
+ {
+ throw new UserFriendlyException($"设备{deviceInfo.DeviceAddress}升级记录失败");
+ }
+
+ //发送OneNET平台设备升级指令,HEX格式字符串
+ taskInput.Commands = new Dictionary()
+ {
+ { upgradeProperty.IoTPlatformRawFieldName, upgradeRecordInput.UpgradeMessage.ToHexString() }
+ };
+
var commandRequest = new OpenApiRequest()
{
- Message = input.Serialize(),
+ Message = taskInput.Serialize(),
};
- var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, commandRequest, deviceInfo.Adapt(), input.Commands.Serialize());
+ var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, commandRequest, deviceInfo.Adapt(), taskInput.Commands.Serialize());
await ioTDBDataChannelManageService.DeviceTelemetryTaskWriterAsync(DataChannelManage.DeviceTelemetryTaskDataChannel.Writer, (DistributedMessageCenterConst.OneNETCommandIssuedEventName, packetTaskInfo));
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251229083115_InitialCreate.Designer.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231054101_InitialCreate.Designer.cs
similarity index 98%
rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20251229083115_InitialCreate.Designer.cs
rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231054101_InitialCreate.Designer.cs
index 7ef729c..33b9501 100644
--- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251229083115_InitialCreate.Designer.cs
+++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231054101_InitialCreate.Designer.cs
@@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace JiShe.IoT.Migrations
{
[DbContext(typeof(IoTDbContext))]
- [Migration("20251229083115_InitialCreate")]
+ [Migration("20251231054101_InitialCreate")]
partial class InitialCreate
{
///
@@ -589,7 +589,7 @@ namespace JiShe.IoT.Migrations
.HasColumnName("ExtraProperties")
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
- b.Property("FirmwareFileId")
+ b.Property("FirmwareFileId")
.HasColumnType("char(36)")
.HasComment("固件文件Id");
@@ -657,10 +657,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int")
.HasComment("旧系统授权最后修改者Id");
- b.Property("ProductDataId")
- .HasColumnType("char(36)")
- .HasComment("产品数据Id");
-
b.Property("Remark")
.HasColumnType("longtext")
.HasComment("备注");
@@ -841,6 +837,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("longtext")
.HasComment("备注");
+ b.Property("SecurityKey")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)")
+ .HasComment("设备接入鉴权key");
+
b.Property("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId")
@@ -899,10 +900,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(50)")
.HasComment("设备地址");
- b.Property("DeviceDataId")
- .HasColumnType("char(36)")
- .HasComment("设备数据Id");
-
b.Property("DeviceName")
.IsRequired()
.HasMaxLength(50)
@@ -915,7 +912,10 @@ namespace JiShe.IoT.Migrations
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
b.Property("FirmwareSignature")
- .HasColumnType("longtext");
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("签名校验值");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
@@ -965,30 +965,41 @@ namespace JiShe.IoT.Migrations
.HasComment("租户ID");
b.Property("UpgradeDate")
- .HasColumnType("datetime(6)");
+ .HasColumnType("datetime(6)")
+ .HasComment("升级日期");
b.Property("UpgradeIdentifier")
- .HasColumnType("bigint");
+ .HasColumnType("bigint")
+ .HasComment("升级标识符号");
b.Property("UpgradeMessage")
- .HasColumnType("longtext");
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("varchar(512)")
+ .HasComment("升级信息");
b.Property("UpgradeResult")
- .HasColumnType("int");
+ .HasColumnType("int")
+ .HasComment("升级结果");
b.Property("UpgradeSource")
- .HasColumnType("int");
+ .HasColumnType("int")
+ .HasComment("升级来源");
b.Property("UpgradeStatus")
- .HasColumnType("int");
+ .HasColumnType("int")
+ .HasComment("升级状态");
b.HasKey("Id");
b.HasIndex("CreationTime");
- b.HasIndex("DeviceDataId");
+ b.HasIndex("DeviceAddress");
- b.HasIndex(new[] { "Id", "DeviceDataId", "NowFirmwareVersion", "CreationTime" }, "IX_ServiceProDeviceUpgradeRecord_IsNotUniqueKey")
+ b.HasIndex("UpgradeIdentifier")
+ .IsUnique();
+
+ b.HasIndex(new[] { "Id", "DeviceAddress", "UpgradeIdentifier", "NowFirmwareVersion", "CreationTime" }, "IX_ServiceProDeviceUpgradeRecord_IsNotUniqueKey")
.IsDescending();
b.ToTable("ServiceProDeviceUpgradeRecord", null, t =>
@@ -1724,6 +1735,12 @@ namespace JiShe.IoT.Migrations
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
+ b.Property("Md5Hash")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("文件MD5");
+
b.Property("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251229083115_InitialCreate.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231054101_InitialCreate.cs
similarity index 99%
rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20251229083115_InitialCreate.cs
rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231054101_InitialCreate.cs
index dae3501..fb5570e 100644
--- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251229083115_InitialCreate.cs
+++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231054101_InitialCreate.cs
@@ -250,6 +250,8 @@ namespace JiShe.IoT.Migrations
FileSize = table.Column(type: "bigint", nullable: false, comment: "文件大小"),
ContentType = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "文件名称")
.Annotation("MySql:CharSet", "utf8mb4"),
+ Md5Hash = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "文件MD5")
+ .Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false)
@@ -879,7 +881,6 @@ namespace JiShe.IoT.Migrations
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- ProductDataId = table.Column(type: "char(36)", nullable: false, comment: "产品数据Id", collation: "ascii_general_ci"),
IoTPlatform = table.Column(type: "int", nullable: false, comment: "物联网平台类型"),
IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id")
.Annotation("MySql:CharSet", "utf8mb4"),
@@ -887,7 +888,7 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"),
FirmwareVersion = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "固件版本")
.Annotation("MySql:CharSet", "utf8mb4"),
- FirmwareFileId = table.Column(type: "char(36)", nullable: true, comment: "固件文件Id", collation: "ascii_general_ci"),
+ FirmwareFileId = table.Column(type: "char(36)", nullable: false, comment: "固件文件Id", collation: "ascii_general_ci"),
FirmwareFileName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false, comment: "固件文件名称")
.Annotation("MySql:CharSet", "utf8mb4"),
FirmwareHashCode = table.Column(type: "longtext", nullable: true)
@@ -954,6 +955,8 @@ namespace JiShe.IoT.Migrations
FirmwareVersion = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "固件版本")
.Annotation("MySql:CharSet", "utf8mb4"),
UpgradeDate = table.Column(type: "datetime(6)", nullable: true, comment: "升级日期"),
+ SecurityKey = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备接入鉴权key")
+ .Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column(type: "datetime(6)", nullable: false),
@@ -1117,7 +1120,6 @@ namespace JiShe.IoT.Migrations
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- DeviceDataId = table.Column(type: "char(36)", nullable: false, comment: "设备数据Id", collation: "ascii_general_ci"),
DeviceName = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "设备名称")
.Annotation("MySql:CharSet", "utf8mb4"),
DeviceAddress = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "设备地址")
@@ -1126,15 +1128,15 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"),
NowFirmwareVersion = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "当前固件版本")
.Annotation("MySql:CharSet", "utf8mb4"),
- UpgradeDate = table.Column(type: "datetime(6)", nullable: false),
- UpgradeSource = table.Column(type: "int", nullable: false),
- UpgradeMessage = table.Column(type: "longtext", nullable: true)
+ UpgradeDate = table.Column(type: "datetime(6)", nullable: false, comment: "升级日期"),
+ UpgradeSource = table.Column(type: "int", nullable: false, comment: "升级来源"),
+ UpgradeMessage = table.Column(type: "varchar(512)", maxLength: 512, nullable: false, comment: "升级信息")
.Annotation("MySql:CharSet", "utf8mb4"),
- UpgradeStatus = table.Column(type: "int", nullable: false),
- UpgradeIdentifier = table.Column(type: "bigint", nullable: false),
- FirmwareSignature = table.Column(type: "longtext", nullable: true)
+ UpgradeStatus = table.Column(type: "int", nullable: false, comment: "升级状态"),
+ UpgradeIdentifier = table.Column(type: "bigint", nullable: false, comment: "升级标识符号"),
+ FirmwareSignature = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "签名校验值")
.Annotation("MySql:CharSet", "utf8mb4"),
- UpgradeResult = table.Column(type: "int", nullable: true),
+ UpgradeResult = table.Column(type: "int", nullable: true, comment: "升级结果"),
ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column(type: "datetime(6)", nullable: false),
@@ -2104,16 +2106,22 @@ namespace JiShe.IoT.Migrations
column: "CreationTime");
migrationBuilder.CreateIndex(
- name: "IX_ServiceProDeviceUpgradeRecord_DeviceDataId",
+ name: "IX_ServiceProDeviceUpgradeRecord_DeviceAddress",
table: "ServiceProDeviceUpgradeRecord",
- column: "DeviceDataId");
+ column: "DeviceAddress");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceUpgradeRecord_IsNotUniqueKey",
table: "ServiceProDeviceUpgradeRecord",
- columns: new[] { "Id", "DeviceDataId", "NowFirmwareVersion", "CreationTime" },
+ columns: new[] { "Id", "DeviceAddress", "UpgradeIdentifier", "NowFirmwareVersion", "CreationTime" },
descending: new bool[0]);
+ migrationBuilder.CreateIndex(
+ name: "IX_ServiceProDeviceUpgradeRecord_UpgradeIdentifier",
+ table: "ServiceProDeviceUpgradeRecord",
+ column: "UpgradeIdentifier",
+ unique: true);
+
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_CreationTime",
table: "ServiceProIoTPlatformThingModelInfo",
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231074453_update20251231.Designer.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231074453_update20251231.Designer.cs
new file mode 100644
index 0000000..265f603
--- /dev/null
+++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251231074453_update20251231.Designer.cs
@@ -0,0 +1,4145 @@
+//
+using System;
+using JiShe.IoT.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+
+#nullable disable
+
+namespace JiShe.IoT.Migrations
+{
+ [DbContext(typeof(IoTDbContext))]
+ [Migration("20251231074453_update20251231")]
+ partial class update20251231
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
+ .HasAnnotation("ProductVersion", "9.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("JiShe.ServicePro.BasicManagement.UserRefreshTokens.UserRefreshToken", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("char(36)")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExpirationTime")
+ .HasColumnType("datetime(6)")
+ .HasComment("过期时间");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit(1)")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsUsed")
+ .HasColumnType("bit(1)")
+ .HasComment("是否使用");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("RefreshToken")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("刷新token");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId");
+
+ b.Property("Token")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)")
+ .HasComment("Token");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)")
+ .HasComment("用户id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RefreshToken");
+
+ b.ToTable("ServiceProUserRefreshTokens", null, t =>
+ {
+ t.HasComment("刷新Token");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.CTWingManagement.CTWingAccount.CTWingAccountInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("AccountId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("账号ID");
+
+ b.Property("AccountName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("账号名称");
+
+ b.Property("AppId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("应用 ID");
+
+ b.Property("AppKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("应用 AppKey");
+
+ b.Property("AppSecret")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("应用 AppSecret");
+
+ b.Property("CommunicationAddress")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("通讯服务地址");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("char(36)")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit(1)")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("PhoneNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("手机号码");
+
+ b.Property("PlatformTenantId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("平台租户ID");
+
+ b.Property("ProductCount")
+ .HasColumnType("int");
+
+ b.Property("Remark")
+ .HasColumnType("longtext")
+ .HasComment("备注");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreationTime");
+
+ b.HasIndex(new[] { "Id", "AccountId", "AccountName", "CreationTime" }, "IX_ServiceProCTWingAccountInfo_IsNotUniqueKey")
+ .IsDescending();
+
+ b.ToTable("ServiceProCTWingAccountInfo", null, t =>
+ {
+ t.HasComment("CTWing账号信息");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.CTWingManagement.CTWingProduct.CTWingPrivateProductInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("AccessType")
+ .HasColumnType("int");
+
+ b.Property("AccountPhoneNumber")
+ .HasColumnType("longtext");
+
+ b.Property("AuthType")
+ .HasColumnType("int");
+
+ b.Property("CTWingAccountId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("账号ID");
+
+ b.Property("CommunicationAddress")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("通讯服务地址");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("DataEncryption")
+ .HasColumnType("int");
+
+ b.Property("DeleterId")
+ .HasColumnType("char(36)")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DeviceCount")
+ .HasColumnType("int");
+
+ b.Property("DeviceThingModelFileId")
+ .HasColumnType("char(36)")
+ .HasComment("设备物模型文件Id");
+
+ b.Property("DeviceThingModelFileName")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)")
+ .HasComment("设备物模型文件名称");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("FeatureAccesskey")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)")
+ .HasComment("设备访问密钥");
+
+ b.Property("IoTPlatformProductId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("产品ID");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit(1)")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsEnabled")
+ .HasColumnType("bit(1)")
+ .HasComment("是否启用");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MasterKey")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)")
+ .HasComment("OpenAPI 通信主密钥");
+
+ b.Property("NetworkType")
+ .HasColumnType("int");
+
+ b.Property("NodeType")
+ .HasColumnType("int");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("ProductDesc")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("必填,产品描述");
+
+ b.Property("ProductName")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("产品名称");
+
+ b.Property("ProductProtocol")
+ .HasColumnType("int");
+
+ b.Property("ProductType")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("一级分类名");
+
+ b.Property("Protocol")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("通讯协议");
+
+ b.Property("Remark")
+ .HasColumnType("longtext")
+ .HasComment("备注");
+
+ b.Property("SecondaryType")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("二级分类名");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.Property("ThirdType")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("三级分类名");
+
+ b.Property("TupDeviceModel")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("设备型号");
+
+ b.Property("TupIsThrough")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreationTime");
+
+ b.HasIndex(new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, "IX_ServiceProCTWingPrivateProductInfo_IsNotUniqueKey")
+ .IsDescending();
+
+ b.ToTable("ServiceProCTWingPrivateProductInfo", null, t =>
+ {
+ t.HasComment("CTWing产品信息");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DataDictionaryManagement.DataDictionaries.Aggregates.DataDictionary", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("char(36)")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("DisplayText")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit(1)")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId");
+
+ b.HasKey("Id");
+
+ b.ToTable("AbpDataDictionaries", null, t =>
+ {
+ t.HasComment("数据字典");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DataDictionaryManagement.DataDictionaries.Aggregates.DataDictionaryDetail", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("DataDictionaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("Description")
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("DisplayText")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ExtendedAttribute")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("IsEnabled")
+ .HasColumnType("bit(1)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Order")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DataDictionaryId");
+
+ b.ToTable("AbpDataDictionaryDetails", null, t =>
+ {
+ t.HasComment("数据字典详情");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.DeviceInfos.DeviceFirmwareInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("char(36)")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("FirmwareFileId")
+ .HasColumnType("char(36)")
+ .HasComment("固件文件Id");
+
+ b.Property("FirmwareFileName")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)")
+ .HasComment("固件文件名称");
+
+ b.Property("FirmwareHashCode")
+ .HasColumnType("longtext");
+
+ b.Property("FirmwareLength")
+ .HasColumnType("bigint");
+
+ b.Property("FirmwareVersion")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("固件版本");
+
+ b.Property("IoTPlatform")
+ .HasColumnType("int")
+ .HasComment("物联网平台类型");
+
+ b.Property("IoTPlatformProductId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("物联网平台中对应的产品Id");
+
+ b.Property("IoTPlatformProductName")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)")
+ .HasComment("物联网平台中对应的产品名称");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit(1)")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsEnable")
+ .HasColumnType("tinyint(1)")
+ .HasComment("是否启用");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("Remark")
+ .HasColumnType("longtext")
+ .HasComment("备注");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreationTime");
+
+ b.HasIndex("IoTPlatformProductId");
+
+ b.HasIndex(new[] { "Id", "IoTPlatformProductId", "FirmwareVersion", "CreationTime" }, "IX_ServiceProDeviceFirmwareInfo_IsNotUniqueKey")
+ .IsDescending();
+
+ b.ToTable("ServiceProDeviceFirmwareInfo", null, t =>
+ {
+ t.HasComment("设备固件信息");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.DeviceInfos.DeviceManagementInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("AccountPhoneNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("账户手机号");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("char(36)")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DeviceAddress")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasComment("设备地址");
+
+ b.Property("DeviceName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("设备名称");
+
+ b.Property("DeviceOnlineStatus")
+ .HasColumnType("int")
+ .HasComment("设备在线状态");
+
+ b.Property("DeviceSource")
+ .HasColumnType("int")
+ .HasComment("设备来源类型");
+
+ b.Property("DeviceThingModelDataId")
+ .HasColumnType("char(36)")
+ .HasComment("设备物模型数据Id");
+
+ b.Property("DeviceType")
+ .HasColumnType("int")
+ .HasComment("设备类型,与业务系统无关,主要区分是网关设备、直连设备");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("FirmwareVersion")
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("固件版本");
+
+ b.Property("IoTPlatform")
+ .HasColumnType("int")
+ .HasComment("物联网平台类型,默认没有指定");
+
+ b.Property("IoTPlatformAccountId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("物联网平台中对应的账号Id");
+
+ b.Property("IoTPlatformDeviceOpenInfo")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("物联网平台中对应的设备Id或者名称");
+
+ b.Property("IoTPlatformProductId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("物联网平台中对应的产品Id");
+
+ b.Property("IoTPlatformProductName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("物联网平台中对应的产品Name");
+
+ b.Property("IoTPlatformResponse")
+ .HasColumnType("text")
+ .HasComment("物联网平台返回的响应信息");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit(1)")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsNeedConfigDevicMdoel")
+ .HasColumnType("bit(1)")
+ .HasComment("是否需要配置设备模型");
+
+ b.Property("IsPlatformPushSuccess")
+ .HasColumnType("tinyint(1)")
+ .HasComment("物联网平台推送是否成功");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("LastOfflineTime")
+ .HasColumnType("datetime(6)")
+ .HasComment("最后离线时间");
+
+ b.Property("LastOnlineTime")
+ .HasColumnType("datetime(6)")
+ .HasComment("最后在线时间");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("PlatformPassword")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)")
+ .HasComment("物联网平台设备密码");
+
+ b.Property("Remark")
+ .HasColumnType("longtext")
+ .HasComment("备注");
+
+ b.Property("SecurityKey")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)")
+ .HasComment("设备接入鉴权key");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.Property("UpgradeDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("升级日期");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreationTime");
+
+ b.HasIndex("DeviceAddress");
+
+ b.HasIndex(new[] { "Id", "DeviceName", "DeviceAddress", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProDeviceInfo_IsNotUniqueKey")
+ .IsDescending();
+
+ b.ToTable("ServiceProDeviceInfo", null, t =>
+ {
+ t.HasComment("设备信息");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.DeviceInfos.DeviceUpgradeRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("char(36)")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DeviceAddress")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("设备地址");
+
+ b.Property("DeviceName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("设备名称");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("FirmwareSignature")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("签名校验值");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit(1)")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("NowFirmwareVersion")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("当前固件版本");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("int")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("OldFirmwareVersion")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("旧的固件版本");
+
+ b.Property("Remark")
+ .HasColumnType("longtext")
+ .HasComment("备注");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.Property