From 1c3d9e4a15222e0774a3c17ffbf020a74af2dad3 Mon Sep 17 00:00:00 2001 From: "nodyang@aliyun.com" Date: Thu, 19 Sep 2024 14:02:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=AB=E6=8F=8F=E6=95=B0=E6=8D=AE=E5=9B=9E?= =?UTF-8?q?=E4=BC=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.TouchSocket/ApiServer.cs | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/SlnMesnac.TouchSocket/ApiServer.cs b/SlnMesnac.TouchSocket/ApiServer.cs index 33a2a5f..a2268d4 100644 --- a/SlnMesnac.TouchSocket/ApiServer.cs +++ b/SlnMesnac.TouchSocket/ApiServer.cs @@ -34,17 +34,18 @@ namespace SlnMesnac.TouchSocket /// /// 扫描的状态回传 /// - /// - /// + /// /// [EnableCors("cors")] [WebApi(HttpMethodType.POST)] public Back ScanStatus(ScanStatusSocket scanStatus) { - BaseLog log = new BaseLog(); - log.LogLevel = "Info"; - log.ErrMsg = ""; - log.Content = scanStatus.ToJsonString(); + BaseLog log = new BaseLog + { + LogLevel = "Info", + ErrMsg = "", + Content = scanStatus.ToJsonString() + }; try { if (scanStatus.is_alarm == 1 && scanStatus.device_status != null && scanStatus.device_status.Count > 0) @@ -76,32 +77,31 @@ namespace SlnMesnac.TouchSocket return new Back(); } - - + + /// - /// 入库开始 + /// 扫描数据回传接口 /// - /// - /// + /// /// [EnableCors("cors")] [WebApi(HttpMethodType.POST)] - public Back ScanBack(ScanLogSocket scanLogStatus) + public Back ScanBack(ScanLogSocket scanLog) { BaseLog log = new BaseLog(); log.LogLevel = "Info"; log.ErrMsg = ""; - log.Content = scanLogStatus.ToJsonString(); + log.Content = scanLog.ToJsonString(); try { var model = new ScanLogModel() { - CreateTime = scanLogStatus.CreateTime, - DataType = scanLogStatus.data_type, - Code = scanLogStatus.code, - Rfid = scanLogStatus.rfid, - Ocr = scanLogStatus.ocr, - Url = scanLogStatus.url + CreateTime = scanLog.CreateTime, + DataType = scanLog.data_type, + Code = scanLog.code, + Rfid = scanLog.rfid, + Ocr = scanLog.ocr, + Url = scanLog.url };