#ifndef HTTP_CONFIGSERVER_H 
 | 
#define HTTP_CONFIGSERVER_H 
 | 
  
 | 
#include <boost/property_tree/json_parser.hpp> 
 | 
#include <boost/property_tree/ptree.hpp> 
 | 
  
 | 
#include "opencv2/opencv.hpp" 
 | 
#include <string> 
 | 
#include "HttpSrvRetRecieve.hpp" 
 | 
#include "LDBTool.h" 
 | 
#include <ErlangDbTool.h> 
 | 
#include <basic/util/BASE64/Base64.h> 
 | 
#include <basic/util/opencv/CvUtil.h> 
 | 
#include <sys/sem.h> 
 | 
  
 | 
#include <LocalDBTool/SqliteFaceEncap.h> 
 | 
#include <CurlDownloadImg.hpp> 
 | 
#include <basic/util/fastdfs/FastFds.hpp> 
 | 
#include <atomic> 
 | 
#include "../FaceSearchServer/CasiaFaceWrapper/CasiaFaceWrapperN.h" 
 | 
#include "AppPipeController.h" 
 | 
  
 | 
typedef std::shared_ptr<HttpServer::Response> PResponse; 
 | 
  
 | 
  
 | 
struct srsPipeController_s { 
 | 
    AppPipeController *appPC; 
 | 
    std::atomic<int> userCounter; 
 | 
}; 
 | 
  
 | 
class devHttpServer_c { 
 | 
public: 
 | 
    devHttpServer_c(); 
 | 
  
 | 
    devHttpServer_c(std::string test); 
 | 
  
 | 
    devHttpServer_c(std::string ip, int port, int pthNum); 
 | 
  
 | 
    ~devHttpServer_c(); 
 | 
  
 | 
//private: 
 | 
    std::string dev_edit(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string dev_show(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string devchn_show(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string devchn_edit(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string dev_search_chns(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string chk_chn_connet(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string cam_edit(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string cam_show(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string chk_cam_connet(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string chk_cam_disconnet(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string dev_del(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string cam_del(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string server_info_edit(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string server_info_show(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string cut_dura_edit(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string cut_dura_show(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string netconfig_edit(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string netconfig_show(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
  
 | 
    std::string addNode(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string searchNode(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string modifyCluName(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string removeNode(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string createDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string deleteDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string updateDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string findAllDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string findLocalDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string addPerson(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string addPersons(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string personIsExists(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string updatePersonByOldId(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
  
 | 
    std::string delPerson(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string loadFaceFeaData(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string getAlarmImageFromVideoFile(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string getRecordVideoPath(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string findDevId(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string editDevName(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
    std::string editDevId(std::string ip, unsigned int port, std::string content, PResponse &response); 
 | 
  
 | 
private: 
 | 
    void init(void); 
 | 
  
 | 
private: 
 | 
  
 | 
    HttpSrvRetRecieve _HttpSrvRetRecieve; 
 | 
    LDBTool db_c; 
 | 
    std::string m_cluster_id; 
 | 
    std::string m_cluster_name; 
 | 
    std::map<std::string, srsPipeController_s> m_rtmp; 
 | 
  
 | 
  
 | 
    ErlangTool::ErlangDbTool *erlangDbTool; 
 | 
    SqliteFaceEncap m_SqliteFaceEncap; 
 | 
  
 | 
//    ErlangDbTool *erlangDbTool; 
 | 
    std::map<std::thread::id, CasiaFaceWrapperN *> m_handleMap; 
 | 
    CvUtil cvutil; 
 | 
    Base64 base64; 
 | 
    std::string m_batch; 
 | 
    std::string m_SerialNumber; 
 | 
  
 | 
    CurlDownloadImg m_curlDownloadImg; 
 | 
  
 | 
    FastFdsWithLock fdfsClient; 
 | 
  
 | 
    bool getDevSerialNumber(const char *ip, const int port, const char *username, \ 
 | 
                            const char *passwd, const char *brand, unsigned char *serialNumber) const; 
 | 
  
 | 
    bool getDevChnList(const char *ip, const int port, const char *username, const char *passwd, \ 
 | 
                                        const char *brand, std::vector<int> &lvecUsefulChans) const; 
 | 
  
 | 
    bool loadCurrentVideo(const char *ip, const int port, const char *username, const char *passwd, \ 
 | 
                                        const char *brand, const int chn, std::string &videopath) const; 
 | 
  
 | 
    bool cam_connect_video_start(std::string ip, int port, std::string username, std::string passwd, \ 
 | 
                                        std::string brand) const; 
 | 
  
 | 
    bool cam_connect_video_stop(std::string ip) const; 
 | 
  
 | 
    void runAllApp() const; 
 | 
  
 | 
    void killFaceSearchServerApp() const; 
 | 
  
 | 
    void killVideoAnalysFromHCApp() const; 
 | 
  
 | 
    bool getUVDevSerialNumber(const char *ip, const char *username, const char *passwd, 
 | 
                              unsigned char *serialNumber = NULL) const; 
 | 
  
 | 
    bool getHKDevSerialNumber(const char *ip, const int port, const char *username, const char *passwd, 
 | 
                              unsigned char *serialNumber = NULL) const; 
 | 
    bool createDevId(const  int& dev_batch, const  int& dev_sequence) ; 
 | 
  
 | 
    std::string getVideoPathByTime(const std::string& time,const std::string& camId,qint64& sub); 
 | 
  
 | 
    std::vector<std::string> forEachFile(const std::string &dir_name); 
 | 
}; 
 | 
  
 | 
#endif 
 |