| 12345678910111213141516171819202122232425262728293031323334353637383940 | 
							- #pragma once
 
- #include "MGWSServer.h"
 
- class CMGDataHandler :
 
-     public IMGWSHandler
 
- {
 
- public:
 
-     CMGDataHandler();
 
-     ~CMGDataHandler();
 
- public:
 
- 	virtual size_t HandlerData(struct mg_connection* c, struct mg_ws_message* wm, char** json) override;
 
-     virtual BOOL HandlerData(const char* ptr, size_t len, char** json) override;
 
- public:
 
-     //读取配置
 
-     int HandleConfRead(string tag, string type, yyjson_mut_doc* doc, yyjson_mut_val* root);
 
-     //写入配置
 
-     int HandleConfWrite(string tag, string type, string name, yyjson_val* conf, yyjson_mut_doc* doc, yyjson_mut_val* root);
 
-     //读取历史
 
-     int HandleQueryHist(string tag, string time, uint32_t subsection, struct mg_connection* c, mg_per_session_data* pInfo, yyjson_mut_doc* doc, yyjson_mut_val* root);
 
-     //报警受理
 
-     int HandleAlarmAck(uint32_t alarm_id, string ack_name, yyjson_mut_doc* doc, yyjson_mut_val* root);
 
-     //报警处理
 
-     int HandleAlarmHandle(uint32_t alarm_id, string handle_name, string handle_info, yyjson_mut_doc* doc, yyjson_mut_val* root);
 
-     //发送未处理报警数据
 
-     int SendUnAckAlarm(mg_connection* c);
 
-     //发送数据给所有客户端
 
-     bool SendToAllClient(struct mg_connection* c, const char* ptr, size_t len);
 
- private:
 
- 	static void ThreadProcForQueryHist(LPMGHISTORY_QUERY);
 
- 	static void ThreadProcForQueryHistDB(LPMGHISTORY_QUERY);
 
- };
 
 
  |