From db9b25e1f03bb4e90886caf884b5aa274f3fd874 Mon Sep 17 00:00:00 2001
From: lzx <2246256235@qq.com>
Date: 星期三, 06 十一月 2024 15:11:43 +0800
Subject: [PATCH] 日志

---
 common.h |  101 ++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 80 insertions(+), 21 deletions(-)

diff --git a/common.h b/common.h
index e6d913b..6d36e1f 100644
--- a/common.h
+++ b/common.h
@@ -90,6 +90,14 @@
 	//鏃ュ織
 	LOGSEARCH_REQ,//鏃ュ織鏌ヨ璇锋眰
 	LOGSEARCH_RES,//鏃ュ織鏌ヨ鍝嶅簲
+	
+	//鍘嗗彶鏌ヨ鍒嗘瀽
+	HISTORY_DEV_REQ,        //鍘嗗彶鏌ヨ纭欢璇锋眰
+	HISTORY_DEV_RES,        //鍘嗗彶鏌ヨ纭欢鍝嶅簲
+	HISTORY_PRODUCE_REQ,    //鍘嗗彶鏌ヨ鐢熶骇璇锋眰
+	HISTORY_PRODUCE_RES,    //鍘嗗彶鏌ヨ鐢熶骇鍝嶅簲
+	HISTORY_ENV_REQ,    //鍘嗗彶鏌ヨ鐜璇锋眰
+	HISTORY_ENV_RES,    //鍘嗗彶鏌ヨ鐜鍝嶅簲
 
 };
 
@@ -828,40 +836,91 @@
 
 
 //鍘嗗彶鏌ヨ鍒嗘瀽
-// 鍘嗗彶鏌ヨ璇锋眰缁撴瀯浣�
-struct HistoryQueryReq {
+
+//鍘嗗彶鏌ヨ鍒嗘瀽
+
+struct warningInfo {
+	int device_id;
+	char des[32];
+	char time[32];
+	float data;
+	char type[16];
+	char status[16];
+};
+// 鍘嗗彶鏌ヨ璁惧淇℃伅璇锋眰缁撴瀯浣�
+struct HistoryDevReq {
 	Head head;
 	//鏍规嵁鏃堕棿鑼冨洿鏌ヨ
 	char startTime[32];
 	char endTime[32];
 	//鍏抽敭瀛楁煡璇�
 	char keyWord[32];
-	HistoryQueryReq() {
+	HistoryDevReq() {
 		// 鍒濆鍖栨暟鎹ご
-		head.type = QUERY_MONOUTPUT_REQ;
-		head.len = sizeof(HistoryQueryReq);
+		head.type = HISTORY_DEV_REQ;
+		head.len = sizeof(HISTORY_DEV_REQ);
 		// 鍒濆鍖栨煡璇㈡潯浠跺瓧娈�
-		std::memset(startTime, 0, sizeof(startTime));
-		std::memset(endTime, 0, sizeof(endTime));
-
+	}
+};
+// 鍘嗗彶鏌ヨ鐢熶骇璁″垝璇锋眰缁撴瀯浣�
+struct HistoryProReq {
+	Head head;
+	//鏍规嵁鏃堕棿鑼冨洿鏌ヨ
+	char startTime[32];
+	char endTime[32];
+	//鍏抽敭瀛楁煡璇�
+	char keyWord[32];
+	HistoryProReq() {
+		// 鍒濆鍖栨暟鎹ご
+		head.type = HISTORY_PRODUCE_REQ;
+		head.len = sizeof(HistoryProReq);
+		// 鍒濆鍖栨煡璇㈡潯浠跺瓧娈�
+	}
+};
+// 鍘嗗彶鏌ヨ鐜淇℃伅璇锋眰缁撴瀯浣�
+struct HistoryEnvReq {
+	Head head;
+	//鏍规嵁鏃堕棿鑼冨洿鏌ヨ
+	char startTime[32];
+	char endTime[32];
+	//鍏抽敭瀛楁煡璇�
+	char keyWord[32];
+	HistoryEnvReq() {
+		// 鍒濆鍖栨暟鎹ご
+		head.type = HISTORY_ENV_REQ;
+		head.len = sizeof(HistoryEnvReq);
+		// 鍒濆鍖栨煡璇㈡潯浠跺瓧娈�
 	}
 };
 
-// 鍘嗗彶鏌ヨ鍝嶅簲缁撴瀯浣�
-
-// 绯荤粺杩愯鐘舵�佽〃鐩稿叧淇℃伅
-struct HistroyInfo {
-	WarningRes warn;//璀︽姤鏌ヨ
-	QDRes dev;//璁惧鏌ヨ
-	QueryPdplanRes  pro;//鐢熶骇璁″垝鏌ヨ
-};
-struct HistoryQueryRes {
+//鏌ヨ璁惧淇℃伅鍝嶅簲缁撴瀯浣�
+struct HistoryDevRes {
 	Head head;
-	HistroyInfo sys[0];
-	HistoryQueryRes() {
+	DevicesInfo dev[0];
+	HistoryDevRes() {
 		// 鍒濆鍖栨暟鎹ご
-		head.type = QUERY_MONOUTPUT_RES;
-		head.len = sizeof(HistoryQueryRes);
+		head.type = HISTORY_DEV_RES;
+		head.len = sizeof(HistoryDevRes);
+	}
+};
+//鏌ヨ鐢熶骇璁″垝鍝嶅簲缁撴瀯浣�
+struct HistoryProRes {
+	Head head;
+	PdplanInfo pro[0];
+	HistoryProRes() {
+		// 鍒濆鍖栨暟鎹ご
+		head.type = HISTORY_PRODUCE_RES;
+		head.len = sizeof(HistoryProRes);
+	}
+};
+//鏌ヨ鐜淇℃伅鍝嶅簲缁撴瀯浣�
+struct HistoryEnvRes {
+	Head head;
+	warningInfo env[0];
+	HistoryEnvRes() {
+		// 鍒濆鍖栨暟鎹ご
+		head.type = HISTORY_ENV_RES;
+		head.len = sizeof(HistoryEnvRes);
 	}
 };
 

--
Gitblit v1.8.0