| | |
| | | #include "vss/model/CamDev.h" |
| | | #include "VssBaseController.h" |
| | | #include <mysql++.h> |
| | | #include <NsqMsgTool.hpp> |
| | | |
| | | using namespace std; |
| | | |
| | |
| | | static CamDevController *instance() { |
| | | static CamDevController instance; |
| | | return &instance; |
| | | } |
| | | |
| | | private: |
| | | //shared_ptr |
| | | BasicMsg::Nsq::NsqMsgProducer *_nsqMsgProducer; |
| | | public: |
| | | void nsqMsgProducerSet(BasicMsg::Nsq::NsqMsgProducer *nsqMsgProducer){ |
| | | _nsqMsgProducer = nsqMsgProducer; |
| | | } |
| | | |
| | | public: |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | { |
| | | std::string topic = "VideoToImageMulth"; |
| | | std::string topic1 = "VideoAnalysFromHC"; |
| | | Json::Value json_cfg; |
| | | json_cfg["cam_del"] = content; |
| | | std::string msg = json_cfg.toStyledString(); |
| | | DBG("msg:" << msg); |
| | | _nsqMsgProducer->Publish(topic, (void *) (&msg)); |
| | | _nsqMsgProducer->Publish(topic1, (void *) (&msg)); |
| | | } |
| | | |
| | | return responseJsonValue.toStyledString(); |
| | | } |
| | | |
| | |
| | | idJsonValue.asString()); |
| | | } |
| | | } |
| | | |
| | | { |
| | | std::string topic = "VideoToImageMulth"; |
| | | std::string topic1 = "VideoAnalysFromHC"; |
| | | Json::Value json_cfg; |
| | | json_cfg["cam_edit"] = content; |
| | | std::string msg = json_cfg.toStyledString(); |
| | | DBG("msg:" << msg); |
| | | _nsqMsgProducer->Publish(topic, (void *) (&msg)); |
| | | _nsqMsgProducer->Publish(topic1, (void *) (&msg)); |
| | | } |
| | | |
| | | return responseJsonValue.toStyledString(); |
| | | } |
| | | |