| | |
| | | #ifndef COMMON_H |
| | | #define COMMON_H |
| | | #include <iostream> |
| | | #include <cstring> |
| | | #include <QString> |
| | | |
| | | #include <string.h> |
| | | |
| | | enum TypeInfo{ |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | <<<<<<< 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]; // 时间戳 |
| | |
| | | struct LogQueryReq { |
| | | Head head; // 数据头 |
| | | char keyWords[32]; // 存储关键字的数组 |
| | | >>>>>>> bb11cc624ab058fc3a6541f91f37985b8caae9b6 |
| | | // 无参构造函数 |
| | | LogQueryReq() { |
| | | head.type = LOGSEARCH_REQ; |
| | |
| | | |
| | | // 日志查询响应结构体 |
| | | 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 |
| | | #endif // COMMON_H |
| | | |