| | |
| | | return out; |
| | | } |
| | | |
| | | //{ |
| | | // "cookie": "abc", //集群cookie |
| | | // "fatherNodeName": "main@192.168.1.186", //引导节点名称,添加引导节点时该值为" "(内为空格) |
| | | // "culID" : "uuid", //集群id |
| | | // "culName" : "name", //集群名称 |
| | | // "devID" : "uuid" //设备id |
| | | //} |
| | | std::string devHttpServer_c::addNode(std::string ip, unsigned int port, std::string content, PResponse &response) { |
| | | DBG("ip:" << ip << "; port:" << port); |
| | | DBG("content: " << content); |
| | |
| | | fieldValues.insert(std::make_pair("bwType", BwType)); |
| | | fieldValues.insert(std::make_pair("startTime", StartTime)); |
| | | fieldValues.insert(std::make_pair("endTime", EndTime)); |
| | | // #todo |
| | | fieldValues.insert(std::make_pair("create_by", createBy)); |
| | | |
| | | fieldValues.insert(std::make_pair("uploadFlag", UploadFlag)); |
| | | fieldValues.insert(std::make_pair("cmpThreshold", CmpThreshold)); |
| | | fieldValues.insert(std::make_pair("enabled", Enabled)); |
| | |
| | | response->write(SimpleWeb::StatusCode::server_error_not_implemented, "{\"error\":\"类型错误,未识别! \"}"); |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | //// #todo 上传。仅黑名单。 |
| | | //// #TODO 根据createBy判断是否需要上传 |
| | |
| | | // auto resType = erlangDbTool->findAllTypeInfo(); |
| | | string json = "["; |
| | | for (auto &item : resDB) { |
| | | //-------------------maybe delete ?------------------------ |
| | | if (item.second.tableName.find("lt_") == 0) { |
| | | continue; |
| | | } |
| | | //-------------------maybe delete end---------------------- |
| | | |
| | | string subJson = "{ "; |
| | | subJson.append("\"uuid\":\"" + item.second.uuid + "\","); |
| | | subJson.append("\"tableName\":\"" + item.second.tableName + "\","); |
| | |
| | | } |
| | | } |
| | | |
| | | if (videoStVec.size() >= 1) { |
| | | std::string strVideoName = strPath + videoStVec[0].ToVideoName(); |
| | | std::vector<VideoName_s_t> videoStVec_; |
| | | auto imgTm_ = AppUtil::ParseFromHypenTimeStr(imgSt.m_timeStamp); |
| | | for (auto &item : videoStVec) { |
| | | auto resTime_ = AppUtil::ParseFromHypenTimeStr(item.m_timeStamp); |
| | | auto timeRes = difftime(mktime(&resTime_), mktime(&imgTm_)); |
| | | if ((timeRes < 0 && difftime(mktime(&imgTm_), mktime(&resTime_)) >= 30) || (timeRes / 60 >= 3)) { |
| | | continue; |
| | | } |
| | | videoStVec_.emplace_back(item); |
| | | } |
| | | |
| | | if (videoStVec_.size() >= 1) { |
| | | std::string strVideoName = strPath + videoStVec_[0].ToVideoName(); |
| | | INFO("ImageName: " << imgKey << " SingleMatchVideo: " << strVideoName); |
| | | return strVideoName; |
| | | } else { |
| | |
| | | std::string createDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | /** |
| | | * |
| | | * 删除数据 底库 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | |
| | | */ |
| | | std::string deleteDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | /*** |
| | | * 更新数据 底库 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string updateDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | /** |
| | | * 查询所有同步库 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string findAllDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | /** |
| | | * 查询所有本地库 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string findLocalDatabase(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | /*** |
| | | * 上传人员 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string addPerson(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | //#todo 批量添加人员借口 |
| | | |
| | | /*** |
| | | * 向同步库批量添加人员及更新人员 |
| | | * feature_addPersonTracking 分支中更新功能分离为新借口 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string addPersons(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | /*** |
| | | * 判断同步库中人员是否存在 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string personIsExists(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | /** |
| | | * 更新同步库中的人员 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string updatePersonByOldId(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | |
| | | /** |
| | | * 删除人员 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string delPerson(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | /** |
| | | * 加载特征 |
| | | * @param ip |
| | | * @param port |
| | | * @param content |
| | | * @param response |
| | | * @return |
| | | */ |
| | | std::string loadFaceFeaData(std::string ip, unsigned int port, std::string content, PResponse &response); |
| | | |
| | | |
| | |
| | | ~FaceDetectServerI(); |
| | | // FaceDetectServer interface |
| | | public: |
| | | /** |
| | | * 人脸检测 |
| | | * @return |
| | | */ |
| | | virtual FaceDetect::Faces faceDetect(Ice::Int, Ice::Int, const std::string &, const Ice::Current &) override; |
| | | |
| | | private: |
| | |
| | | |
| | | // FaceDetectServer interface |
| | | public: |
| | | /** |
| | | * 人脸二次属性提取 |
| | | * @return |
| | | */ |
| | | virtual FaceDetect::ThftResult faceProperty(Ice::Int, Ice::Int, const FaceDetect::FacePos &, const std::string &, const Ice::Current &) override; |
| | | |
| | | private: |