1
0

module_call_help.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef MODULE_CALL_HELP_H
  2. #define MODULE_CALL_HELP_H
  3. /**
  4. *@brief 呼救模块
  5. * 把呼救消息保存到数据库,同时推送给web
  6. * @author 戴月腾
  7. * @date 2018-08-09
  8. */
  9. #include "module_singleton_base.h"
  10. #include"card.h"
  11. #include"websocket/sio/sio_client.h"
  12. /**
  13. * @brief 呼救类
  14. * 把呼救消息保存到数据库,同时推送给web, 单例
  15. */
  16. class module_call_help : public singleton_base<module_call_help>
  17. {
  18. private:
  19. friend class singleton_base<module_call_help>;
  20. module_call_help()
  21. {
  22. }
  23. public:
  24. /**
  25. * @brief //1.如果已经有呼救告警
  26. //2.web取消告警。status_help && status_help_cancel 置为status_help_dealed
  27. //3.如果底层已经没有呼救则,取消后,不会再次进行呼救。因为status_help已经不会置为status_error。
  28. //4.如果底层还在呼救。这时候不管status_help是何种状态,极大的可能是error.status_help_cancel的存在都会取消。
  29. //并且还要保证等待线程把json传送到前端
  30. */
  31. void rev_from_card_help(std::shared_ptr<card_location_base> card_ptr);
  32. /**
  33. * @brief 接收到web端发来的处理呼救请求
  34. * @param data_map
  35. */
  36. void accept_web_deal_help(sio::message::ptr const& data);
  37. static std::string get_json_help();
  38. };
  39. #endif