From 1055d5ce8bea8ed299a1f102e58a1664a0961f6c Mon Sep 17 00:00:00 2001
From: Kevin12345 <2353144101@qq.com>
Date: 星期五, 01 十一月 2024 18:19:15 +0800
Subject: [PATCH] 修改结构体

---
 common.h |  159 +++++++++++++++++++++++++++++++++-------------------
 1 files changed, 100 insertions(+), 59 deletions(-)

diff --git a/common.h b/common.h
index 3804b49..03aa54b 100644
--- a/common.h
+++ b/common.h
@@ -1,9 +1,7 @@
 #ifndef COMMON_H
 #define COMMON_H
-#include <iostream>
-#include <cstring>
-#include <QString>
 
+#include <string.h>
 
 enum TypeInfo{
 
@@ -25,8 +23,8 @@
     //璁惧绠$悊
     AD_Req,//娣诲姞璁惧璇锋眰
 	AD_Res,//娣诲姞璁惧鍝嶅簲
-	DD_Req,//鍋滄璁惧璇锋眰
-	DD_Res,//鍋滄璁惧璇锋眰
+	CD_Req,//鍏抽棴璁惧璇锋眰
+	CD_Res,//鍏抽棴璁惧璇锋眰
 	PD_Req,//鏆傚仠璁惧璇锋眰
 	PD_Res,//鏆傚仠璁惧璇锋眰
 
@@ -273,15 +271,22 @@
 {
 	char Device_Name[32];
 	char Device_Status[32];
-	char Start_Time[32];
-	char Work_Time[32];
 	char Manufacturer[100];
 	char Devices_Type[32];
+	double Longitude;
+	double Latitude;
 };
 struct ADRes
 {
 	Head head;
-
+	char Device_Name[32];
+	char Device_Status[32];
+	char Start_Time[32];
+	char Work_Time[32];
+	char Manufacturer[100];
+	char Devices_Type[32];
+	double Longitude;
+	double Latitude;
 	ADPermission per;
 	ADRes() {
 		head.type = AD_Res;
@@ -290,17 +295,17 @@
 
 };
 
-//鍋滄璁惧
-struct DDReq
+//鍏抽棴璁惧
+struct CDReq
 {
 	Head head;
 	char Device_Name[32];
-	DDReq() {
-		head.type = DD_Req;
-		head.len = sizeof(DDReq);
+	CDReq() {
+		head.type = CD_Req;
+		head.len = sizeof(CDReq);
 	}
 };
-struct DDPermission
+struct CDPermission
 {
 	char Device_Name[32];
 	char Device_Status[32];
@@ -308,15 +313,18 @@
 	char Work_Time[32];
 	char Manufacturer[100];
 	char Devices_Type[32];
+	double Longitude;
+	double Latitude;
 };
-struct DDRes
+struct CDRes
 {
 	Head head;
-
-	DDPermission per;
-	DDRes() {
-		head.type = DD_Res;
-		head.len = sizeof(DDRes);
+	char Device_Status[32];
+	int status;
+	CDPermission per;
+	CDRes() {
+		head.type = CD_Res;
+		head.len = sizeof(CDRes);
 	}
 };
 
@@ -338,11 +346,15 @@
 	char Work_Time[32];
 	char Manufacturer[100];
 	char Devices_Type[32];
+	double Longitude;
+	double Latitude;
 };
 struct PDRes
 {
 	Head head;
-
+	char Device_Status[32];
+	char Work_Time[32];
+	int status;
 	PDPermission per;
 	PDRes() {
 		head.type = PD_Res;
@@ -635,26 +647,26 @@
 // 绯荤粺杩愯鐘舵�佽〃鐩稿叧淇℃伅
 struct Histroy_Info{
         int sysId;  // 瀵瑰簲绯荤粺杩愯鐘舵�佽〃鐨勮褰曠紪鍙�
-        QString sysDataCollectionTime;  // 鏁版嵁閲囬泦鏃堕棿
-        QString sysDeviceType;  // 璁惧绫诲瀷
-        QString sysDeviceId;  // 璁惧缂栧彿
-        QString sysDeviceStatus;  // 璁惧鐘舵��
-        QString sysSystemStatus;  // 绯荤粺鏁翠綋杩愯鐘舵�佹弿杩�
+        char sysDataCollectionTime[50];  // 鏁版嵁閲囬泦鏃堕棿
+        char sysDeviceType[50];  // 璁惧绫诲瀷
+        char sysDeviceId[50];  // 璁惧缂栧彿
+        char sysDeviceStatus[50];  // 璁惧鐘舵��
+        char sysSystemStatus[50];  // 绯荤粺鏁翠綋杩愯鐘舵�佹弿杩�
 
         int devId;  // 瀵瑰簲璁惧璇︾粏淇℃伅琛ㄧ殑璁板綍缂栧彿
-        QString devDeviceType;  // 璁惧绫诲瀷锛堜笌绯荤粺杩愯鐘舵�佽〃涓殑璁惧绫诲瀷瀵瑰簲锛屽彲鐢ㄤ簬鍏宠仈锛�
-        QString devDeviceId;  // 璁惧缂栧彿锛堜笌绯荤粺杩愯鐘舵�佽〃涓殑璁惧缂栧彿瀵瑰簲锛屽彲鐢ㄤ簬鍏宠仈锛�
-        QString devModel;  // 璁惧鍨嬪彿
-        QString runDeviceStatus;  // 璁惧鐘舵��
-        QString runFaultAlarmTime;  // 鏁呴殰鎶ヨ鏃堕棿
-        QString runFaultDescription;  // 鏁呴殰璇︾粏鎻忚堪
+        char devDeviceType[50];  // 璁惧绫诲瀷锛堜笌绯荤粺杩愯鐘舵�佽〃涓殑璁惧绫诲瀷瀵瑰簲锛屽彲鐢ㄤ簬鍏宠仈锛�
+        char devDeviceId[50];  // 璁惧缂栧彿锛堜笌绯荤粺杩愯鐘舵�佽〃涓殑璁惧缂栧彿瀵瑰簲锛屽彲鐢ㄤ簬鍏宠仈锛�
+        char devModel[50];  // 璁惧鍨嬪彿
+        char runDeviceStatus[50];  // 璁惧鐘舵��
+        char runFaultAlarmTime[50];  // 鏁呴殰鎶ヨ鏃堕棿
+        char runFaultDescription[50];  // 鏁呴殰璇︾粏鎻忚堪
 
         int safetyId;  // 瀵瑰簲璁惧瀹夊叏鐘舵�佽〃鐨勮褰曠紪鍙�
-        QString safetyDataCollectionTime;  // 鏁版嵁閲囬泦鏃堕棿锛堝彲鐢ㄤ簬鍏宠仈涓嶅悓琛ㄥ湪鍚屼竴鏃堕棿鐐圭殑鏁版嵁鎯呭喌锛�
-        QString safetyDeviceType;  // 璁惧绫诲瀷锛堢敤浜庡叧鑱旓級
-        QString safetyDeviceId;  // 璁惧缂栧彿锛堢敤浜庡叧鑱旓級
-        QString safetyStatus;  // 璁惧瀹夊叏鐘舵��
-        QString safetyParameter;  // 瀹夊叏鍙傛暟
+        char safetyDataCollectionTime[50];  // 鏁版嵁閲囬泦鏃堕棿锛堝彲鐢ㄤ簬鍏宠仈涓嶅悓琛ㄥ湪鍚屼竴鏃堕棿鐐圭殑鏁版嵁鎯呭喌锛�
+        char safetyDeviceType[50];  // 璁惧绫诲瀷锛堢敤浜庡叧鑱旓級
+        char safetyDeviceId[50];  // 璁惧缂栧彿锛堢敤浜庡叧鑱旓級
+        char safetyStatus[50];  // 璁惧瀹夊叏鐘舵��
+        char safetyParameter[50];  // 瀹夊叏鍙傛暟
 };
 // 鍘嗗彶鏌ヨ鍝嶅簲缁撴瀯浣�
 // 瀹夊叏鐘舵�佽〃鐩稿叧淇℃伅
@@ -683,7 +695,7 @@
 struct VersionNumRes        // 鐗堟湰鍙峰搷搴�
 {
 	Head head;
-	char version_id[64]; // 鐗堟湰鍙�
+	char versionId[64]; // 鐗堟湰鍙�
 	VersionNumRes() {
 		head.type = VERSION_NUM_RES;
 		head.len = sizeof(VersionNumRes);
@@ -693,8 +705,8 @@
 // 鏂囦欢浼犺緭
 struct FileInfo
 {
-	char file_name[256];
-	long long file_size;
+	char fileName[256];
+	long long fileSize;
     char s_filepath[128];
 	char content[0];
 };
@@ -712,7 +724,7 @@
 struct UploadFileRes {      // 涓婁紶鏂囦欢鐨勫搷搴�
     Head head;
     bool state = false;
-    char file_name[256];
+    char fileName[256];
     long long file_size;
     UploadFileRes()
     {
@@ -725,14 +737,9 @@
 // 璇锋眰
 struct VersionInfoEntryReq {
     Head head;
-    char version_id[64]; // 鐗堟湰鍙�
-    char version_id_old[64]; // 涓婁竴涓増鏈彿
-    char s_filepath[16][128];	//鏈嶅姟鍣ㄦ斁鏈�鏂扮増鏈殑璺緞
-    char version_description[256]; //鏇存柊鍐呭
-    char version_creattime[32]; // 鏇存柊鏃堕棿
-    char filename[16][128];
-    long long filesize[16];
-    char c_filepath[16][128];
+    char versionId[64]; // 鐗堟湰鍙�
+    char versionIdOld[64]; // 涓婁竴涓増鏈彿
+    char context[0];		//鍖呭惈涓嬭浇鏂囦欢淇℃伅
     int fileNum;
 
     VersionInfoEntryReq()
@@ -757,7 +764,7 @@
 struct VersionUpdateReq {
     Head head;
 
-    char cur_version_id[64]; // 鐗堟湰鍙�
+    char curVersionId[64]; // 鐗堟湰鍙�
     VersionUpdateReq()
     {
         head.type = VERSION_UPDATE_REQ;
@@ -769,9 +776,9 @@
 struct VersionUpdateRes {
     Head head;
     bool state = false;
-    char version_id[64]; // 鐗堟湰鍙�
-    char update_date[32]; // 鏇存柊鏃堕棿
-    char version_description[1024]; //鏇存柊鎻忚堪
+    char versionId[64]; // 鐗堟湰鍙�
+    char updateDate[32]; // 鏇存柊鏃堕棿
+    char versionDescription[1024]; //鏇存柊鎻忚堪
 
     VersionUpdateRes()
     {
@@ -783,7 +790,7 @@
 // 鐗堟湰鏇存柊鏂囦欢涓嬭浇璇锋眰
 struct FileDownloadsReq {
     Head head;
-    char version_id[64]; // 鐗堟湰鍙�
+    char versionId[64]; // 鐗堟湰鍙�
     FileDownloadsReq()
     {
         head.type = FILE_DOWNLOADS_REQ;
@@ -794,12 +801,12 @@
 // 鐗堟湰鏇存柊鏂囦欢涓嬭浇鍝嶅簲
 struct FileDownloadsRes {
     Head head;
-    char version_id[64]; // 鐗堟湰鍙�
+    char versionId[64]; // 鐗堟湰鍙�
     char filename[128]; //鏂囦欢鍚�
     long long filesize; //鏂囦欢澶у皬
     char c_filepath[128];	//瀹㈡埛绔斁鏈�鏂扮増鏈殑鏈湴璺緞
     int fileNum; // 鏂囦欢鏁伴噺
-    long long all_fileSize; // 鏂囦欢鎬诲ぇ灏�
+    long long allFileSize; // 鏂囦欢鎬诲ぇ灏�
     char content[0];
     FileDownloadsRes()
     {
@@ -812,8 +819,8 @@
 struct DownloadSuccessfullyRes{
     Head head;
     bool state = false;
-    char file_name[256];
-    long long file_size;
+    char fileName[256];
+    long long fileSize;
     DownloadSuccessfullyRes()
     {
         head.type = DOWNLOAD_SUCCESSFULLY_RES;
@@ -821,6 +828,26 @@
     }
 };
 
+<<<<<<< HEAD
+//鏃ュ織鏌ヨ
+
+enum Typeinfo{
+	LOGSEARCH_REQ,//鏃ュ織鏌ヨ璇锋眰
+	LOGSEARCH_RES,//鏃ュ織鏌ヨ鍝嶅簲
+
+};
+
+struct Head
+{
+    int type;   // 鍔熻兘绫诲瀷
+    int len;    //灏佸寘闀垮害
+
+};
+// 鏃ュ織鏌ヨ璇锋眰缁撴瀯浣�
+struct LogQueryReq {
+    Head heade;                 // 鏁版嵁澶�
+    char keyWords[0];            // 瀛樺偍澶氫釜鍏抽敭瀛楃殑鏌旀�ф暟缁�
+=======
 //鏃ュ織
 struct ParsedLog { 
     char timestamp[64]; // 鏃堕棿鎴�
@@ -834,7 +861,12 @@
 // 鏃ュ織鏌ヨ璇锋眰缁撴瀯浣�
 struct LogQueryReq {
     Head head;                 // 鏁版嵁澶�
+<<<<<<< HEAD
     char keyWords[32];         // 瀛樺偍鍏抽敭瀛楃殑鏁扮粍
+=======
+    char keyWords[32];            // 瀛樺偍鍏抽敭瀛楃殑鏁扮粍
+>>>>>>> bb11cc624ab058fc3a6541f91f37985b8caae9b6
+>>>>>>> 3d2b586460830c5dbebffe49bd3d5c2477de0aee
     // 鏃犲弬鏋勯�犲嚱鏁�
     LogQueryReq() {
         head.type = LOGSEARCH_REQ;
@@ -844,18 +876,27 @@
 
 // 鏃ュ織鏌ヨ鍝嶅簲缁撴瀯浣�
 struct LogQueryRes {
+<<<<<<< HEAD
+    Head heade;  
+=======
     Head head;  
+>>>>>>> bb11cc624ab058fc3a6541f91f37985b8caae9b6
     int status;                    // 鍝嶅簲鐘舵�� (濡� 0 琛ㄧず鎴愬姛锛岄潪 0 琛ㄧず澶辫触)
     char errorMessage[256];        // 閿欒淇℃伅锛堝鏋滄湁锛�
     
     // 鏃犲弬鏋勯�犲嚱鏁�
     LogQueryRes() {
         head.type = LOGSEARCH_RES;
+<<<<<<< HEAD
+	    head.len = sizeof(LogQueryRes);
+=======
 		head.len = sizeof(LogQueryRes);
+>>>>>>> bb11cc624ab058fc3a6541f91f37985b8caae9b6
     }
 };
 
 
 
 
-#endif // COMMON_H
\ No newline at end of file
+#endif // COMMON_H
+

--
Gitblit v1.8.0