From 41df64845b465d461afa52f9f7ba45e30f018b9f Mon Sep 17 00:00:00 2001 From: dev01 Date: Thu, 1 Feb 2024 15:29:28 +0800 Subject: [PATCH] =?UTF-8?q?[WebAPI]=20GeHistoryRawData=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E5=B8=83=E6=9E=97=E5=80=BC=E5=88=A4=E6=96=B7=E6=8A=93?= =?UTF-8?q?=E5=8F=96=20Device=5Fitem=20is=5Fbool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/HistoryController.cs | 5 +++-- FrontendWebApi/Models/HistoryClass.cs | 2 ++ FrontendWebApi/appsettings.Development.json | 10 ++++++---- FrontendWebApi/appsettings.json | 10 ++++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index f3a5740..8591f8a 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -1119,7 +1119,8 @@ namespace FrontendWebApi.ApiControllers temp.device_name, temp.full_name as item_name, temp.points, - temp.unit + temp.unit, + temp.is_bool from ( select di.*, @@ -1240,7 +1241,7 @@ namespace FrontendWebApi.ApiControllers var abstime = obj["abstime"]["@val"].ToString(); historyRawData.Timestamp = Convert.ToDateTime(abstime).ToString("yyyy-MM-dd HH:mm:ss"); //取得資料 - string tag = device_item_info.Points.Equals("st") || device_item_info.Points.Equals("ST") ? "bool" : "real"; + string tag = device_item_info.Is_bool == "1" ? "bool" : "real"; historyRawData.Value = obj[tag]["@val"].ToString(); historyRawDatas.Add(historyRawData); diff --git a/FrontendWebApi/Models/HistoryClass.cs b/FrontendWebApi/Models/HistoryClass.cs index b062150..9fdeb41 100644 --- a/FrontendWebApi/Models/HistoryClass.cs +++ b/FrontendWebApi/Models/HistoryClass.cs @@ -279,6 +279,8 @@ namespace FrontendWebApi.Models public string Item_name { get; set; } public string Points { get; set; } public string Unit { get; set; } + + public string Is_bool { get; set; } } public class HistoryRawData : DeviceItemInfo diff --git a/FrontendWebApi/appsettings.Development.json b/FrontendWebApi/appsettings.Development.json index 84e653e..d3bc4e5 100644 --- a/FrontendWebApi/appsettings.Development.json +++ b/FrontendWebApi/appsettings.Development.json @@ -19,12 +19,14 @@ }, "DBConfig": { "MySqlDBConfig": { - "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 - "Port": "js2LutKe+rdjzdxMPQUrvQ==", + "Server": "CYGthbCeGtAXT4s1NOSJHQ==", //0.132 + "Port": "mkF51jVbg40V5K5eTh2Ckw==", + //"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 + //"Port": "js2LutKe+rdjzdxMPQUrvQ==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp - //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome - "Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 + "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome + //"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT diff --git a/FrontendWebApi/appsettings.json b/FrontendWebApi/appsettings.json index 81a3162..96b02f2 100644 --- a/FrontendWebApi/appsettings.json +++ b/FrontendWebApi/appsettings.json @@ -25,15 +25,17 @@ // "Password": "2gi7rOmGha2VdXC5vtHxhg==" //}, "MySqlDBConfig": { - "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 - "Port": "js2LutKe+rdjzdxMPQUrvQ==", + "Server": "CYGthbCeGtAXT4s1NOSJHQ==", //0.132 + "Port": "mkF51jVbg40V5K5eTh2Ckw==", + //"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 + //"Port": "js2LutKe+rdjzdxMPQUrvQ==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //三菱 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT - //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome + "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office - "Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 + //"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 "Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" },