From f3199003695b1cb1aeeb8370589e0aeb98d88ab5 Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Mon, 21 Jul 2025 16:17:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E9=97=B4=E8=AE=BE=E5=A4=87=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appsettings.Development.json | 4 +++ .../appsettings.Production.json | 4 +++ .../Dto/ProductionEquipmentInput.cs | 36 +++++++++++++++++++ .../CommonServices/ICommonService.cs | 9 ++++- .../CommonServices/CommonService.cs | 12 +++++++ .../Controllers/CommonController.cs | 13 +++++++ 6 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/JiShe.IoT.Application.Contracts/CommonServices/Dto/ProductionEquipmentInput.cs diff --git a/host/JiShe.IoT.HttpApi.Host/appsettings.Development.json b/host/JiShe.IoT.HttpApi.Host/appsettings.Development.json index c879aea..3b2a161 100644 --- a/host/JiShe.IoT.HttpApi.Host/appsettings.Development.json +++ b/host/JiShe.IoT.HttpApi.Host/appsettings.Development.json @@ -74,5 +74,9 @@ "UsePrepayDB": true, "UseEnergyDB": true, "PrintLog": false + }, + "OneNETSecureReceiveOptions": { + "OneNETVerifySignatureToken": "SIcPQnpMgaFDmNlIjNmzq5smshz7cKrh", + "OneNETAesKey": "RPTEIGCA1KvDEXS1" } } \ No newline at end of file diff --git a/host/JiShe.IoT.HttpApi.Host/appsettings.Production.json b/host/JiShe.IoT.HttpApi.Host/appsettings.Production.json index a09a17e..726d7fc 100644 --- a/host/JiShe.IoT.HttpApi.Host/appsettings.Production.json +++ b/host/JiShe.IoT.HttpApi.Host/appsettings.Production.json @@ -70,5 +70,9 @@ "AutomaticDayFreezeTime": "02:30:00", "AutomaticMonthFreezeTime": "03:30:00", "DefaultProtocolPlugin": "T37612012ProtocolPlugin" + }, + "OneNETSecureReceiveOptions": { + "OneNETVerifySignatureToken": "SIcPQnpMgaFDmNlIjNmzq5smshz7cKrh", + "OneNETAesKey": "RPTEIGCA1KvDEXS1" } } \ No newline at end of file diff --git a/src/JiShe.IoT.Application.Contracts/CommonServices/Dto/ProductionEquipmentInput.cs b/src/JiShe.IoT.Application.Contracts/CommonServices/Dto/ProductionEquipmentInput.cs new file mode 100644 index 0000000..6887d15 --- /dev/null +++ b/src/JiShe.IoT.Application.Contracts/CommonServices/Dto/ProductionEquipmentInput.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace JiShe.IoT.CommonServices.Dto +{ + /// + /// 生产设备 + /// + public class ProductionEquipmentInput + { + /// + /// 用于计算签名字符的随机串 + /// + public string Nonce { get; set; } + + /// + /// 加密签名,用以校验推送客户端身份合法性,校验方法见实例验证 + /// + public string Signature { get; set; } + + /// + /// 签名有效期(毫秒) + /// + public long Timestamp { get; set; } + + /// + /// 消息内容,JSON字符串,具体的设备相关信息 + /// + [JsonPropertyName("msg")] + public string Message { get; set; } + } +} diff --git a/src/JiShe.IoT.Application.Contracts/CommonServices/ICommonService.cs b/src/JiShe.IoT.Application.Contracts/CommonServices/ICommonService.cs index 24ba65a..b8e4c38 100644 --- a/src/JiShe.IoT.Application.Contracts/CommonServices/ICommonService.cs +++ b/src/JiShe.IoT.Application.Contracts/CommonServices/ICommonService.cs @@ -10,7 +10,7 @@ using System.Threading.Tasks; namespace JiShe.IoT.CommonServices { /// - /// 通用服务 + /// 通用服务 /// public interface ICommonService { @@ -26,5 +26,12 @@ namespace JiShe.IoT.CommonServices /// /// List GetSelectResultList(SelectResultListInput input); + + /// + /// 接收车间生产设备信息 + /// + /// + /// + Task ReceiveWorkshopProductionEquipment(ProductionEquipmentInput input); } } diff --git a/src/JiShe.IoT.Application/CommonServices/CommonService.cs b/src/JiShe.IoT.Application/CommonServices/CommonService.cs index acf92c8..2f5a79b 100644 --- a/src/JiShe.IoT.Application/CommonServices/CommonService.cs +++ b/src/JiShe.IoT.Application/CommonServices/CommonService.cs @@ -41,5 +41,17 @@ namespace JiShe.IoT.CommonServices return selectResults; } + + + /// + /// 接收车间生产设备信息 + /// + /// + /// + [AllowAnonymous] + public async Task ReceiveWorkshopProductionEquipment(ProductionEquipmentInput input) + { + await Task.CompletedTask; + } } } diff --git a/src/JiShe.IoT.HttpApi/Controllers/CommonController.cs b/src/JiShe.IoT.HttpApi/Controllers/CommonController.cs index 7b95813..b7beb37 100644 --- a/src/JiShe.IoT.HttpApi/Controllers/CommonController.cs +++ b/src/JiShe.IoT.HttpApi/Controllers/CommonController.cs @@ -29,5 +29,18 @@ namespace JiShe.IoT.Controllers { return _commonService.GetSelectResultList(input); } + + /// + /// 接收车间生产设备信息 + /// + /// + /// + [HttpGet("WorkshopProductionEquipment")] + [SwaggerOperation(summary: "车间生产设备信息", Tags = new[] { "Common" })] + public async Task ReceiveWorkshopProductionEquipment(ProductionEquipmentInput input) + { + + await Task.CompletedTask; + } } }