#pragma once #include #include #include #include #include #include #include "Util/logger.h" #include "Util/NoticeCenter.h" #include "Poller/EventPoller.h" #include "Player/PlayerProxy.h" #include "Rtmp/RtmpPusher.h" #include "Common/config.h" #include "Pusher/MediaPusher.h" #include "Extension/Frame.h" #include "Util/SqlPool.h" #include "Network/TcpClient.h" #include "Poller/Timer.h" using namespace std; class NettyHttpCrowdingDegreeConfig { public: std::string addTime; std::string updateTime; int createBy; int updateBy; int enableFlag; std::string attr1; std::string attr2; std::string attr3; int appId; int configId; std::string conKey; std::string conValue; std::string active; std::string remark; public: NettyHttpCrowdingDegreeConfig() {} ~NettyHttpCrowdingDegreeConfig() {} bool jsonToObject(const rapidjson::Value& object){ const auto end = object.MemberEnd(); if(end == object.FindMember("addTime") || !object["addTime"].IsString()){ return false; }else{ addTime = object["addTime"].GetString(); } if(end == object.FindMember("updateTime") || !object["updateTime"].IsString()){ return false; }else{ updateTime = object["updateTime"].GetString(); } if(end == object.FindMember("createBy") || !object["createBy"].IsInt()){ return false; }else{ createBy = object["createBy"].GetInt(); } if(end == object.FindMember("updateBy") || !object["updateBy"].IsInt()){ return false; }else{ updateBy = object["updateBy"].GetInt(); } if(end == object.FindMember("appId") || !object["appId"].IsInt()){ return false; }else{ appId = object["appId"].GetInt(); } if(end == object.FindMember("configId") || !object["configId"].IsInt()){ return false; }else{ configId = object["configId"].GetInt(); } if(end == object.FindMember("conKey") || !object["conKey"].IsString()){ return false; }else{ conKey = object["conKey"].GetString(); } if(end == object.FindMember("conValue") || !object["conValue"].IsString()){ return false; }else{ conValue = object["conValue"].GetString(); } return true; } /** * @description: 数据同步 * @param {*} * @return {*} */ bool NettyClientDataSync() { vector> sqlRet; SqlWriter sqlInsert("INSERT INTO MIVA_DB.SystemConfig(addTime, updateTime, createBy, updateBy, attr1, attr2, attr3, appId, configId, conKey, conValue, active, remark) VALUES(\ '?','?','?','?','?','?','?','?','?','?','?','?','?' )"); sqlInsert << addTime << updateTime << createBy << updateBy << attr1 << attr2 << attr3 << appId << configId << conKey << conValue << active << remark << sqlRet; return true; } };