Browse Source

修改 module_web

daiyueteng 6 years ago
parent
commit
edb19f789c
2 changed files with 12 additions and 7 deletions
  1. 6 5
      module_service/module_web.cpp
  2. 6 2
      module_service/module_web.h

+ 6 - 5
module_service/module_web.cpp

@@ -1,11 +1,12 @@
 #include "module_web.h"
-#include"module_const.h"
+
 #include"module_call_help.h"
 #include"module_call.h"
-#include"module_area.h"
 #include"module_attendance_person.h"
 #include"module_meta_date_changed.h"
 
+#include"log.h"
+
 void module_web::accept( int ID, std::string const& name,
                          sio::message::ptr const& data, bool need_ack, sio::message::list &ack_resp )
 {
@@ -87,7 +88,7 @@ void module_web::response_login()
         doc.AddMember(JSON_ROOT_KEY_VERSION, INTERFACE_VERSION, allocator);
         doc.AddMember(JSON_ROOT_KEY_DATA, nodes, allocator);
 
-        tool_other::send_json(JSON_CMD_VALUE_PUSH, tool_json::doc_to_json(doc));
+        swsClientMgr.send(JSON_CMD_VALUE_PUSH, tool_json::doc_to_json(doc));
     }
 }
 
@@ -100,13 +101,13 @@ void module_web::run()
     {
         delete_end(arr);
 
-        tool_other::send_json(JSON_CMD_VALUE_PUSH, event_list::evs_to_json(arr));
+        swsClientMgr.send(JSON_CMD_VALUE_PUSH, event_list::evs_to_json(arr));
     }
 
     std::string help = module_call_help::get_json_help();
     if(!help.empty())
     {
-        tool_other::send_json(JSON_CMD_VALUE_PUSH, help);
+        swsClientMgr.send(JSON_CMD_VALUE_PUSH, help);
     }
 }
 

+ 6 - 2
module_service/module_web.h

@@ -9,10 +9,14 @@
 
 #include <memory>
 #include <string>
-#include"module_const.h"
-
+#include<vector>
 #include "rapidjson/prettywriter.h"
 #include "rapidjson/document.h"
+
+#include"config_file.h"
+#include"ya_event.h"
+#include"module_singleton_base.h"
+#include"module_i_thread.h"
 #include "websocket/wsClientMgr.h"
 
 class module_web : public i_thread, public singleton_base<module_web>