| | |
| | | */
|
| | | class VssChannelTblController : public VssBaseController {
|
| | | private:
|
| | | /** 创建二级设备表构造函数 */
|
| | | VssChannelTblController() {}
|
| | | /** 创建二级设备表构造函数 */
|
| | | VssChannelTblController() {}
|
| | | public:
|
| | | /** 创建二级设备表单例模式 */
|
| | | /** 创建二级设备表单例模式 */
|
| | | static VssChannelTblController* instance() {
|
| | | static VssChannelTblController instance;
|
| | | return &instance;
|
| | | }
|
| | | public:
|
| | | /** 注册{label}http服务 */
|
| | | /** 注册{label}http服务 */
|
| | | void registerHttpServices(HttpSrvRetRecieve& _HttpSrvRetRecieve) {
|
| | |
|
| | | _HttpSrvRetRecieve.setInfo("^/addVssChannelTbl$", "POST",
|
| | | std::bind(&VssChannelTblController::addVssChannelTbl, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | | |
| | | _HttpSrvRetRecieve.setInfo("^/delVssChannelTbl$", "POST",
|
| | | std::bind(&VssChannelTblController::delVssChannelTbl, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | | |
| | | _HttpSrvRetRecieve.setInfo("^/updateVssChannelTbl$", "POST",
|
| | | std::bind(&VssChannelTblController::updateVssChannelTbl, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | | |
| | | _HttpSrvRetRecieve.setInfo("^/findVssChannelTbl$", "POST",
|
| | | std::bind(&VssChannelTblController::findVssChannelTbl, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | | |
| | | _HttpSrvRetRecieve.setInfo("^/findVssChannelTblList$", "POST",
|
| | | std::bind(&VssChannelTblController::findVssChannelTblList, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | | _HttpSrvRetRecieve.setInfo("^/addVssChannelTbl$", "POST",
|
| | | std::bind(&VssChannelTblController::addVssChannelTbl, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | |
|
| | | _HttpSrvRetRecieve.setInfo("^/delVssChannelTbl$", "POST",
|
| | | std::bind(&VssChannelTblController::delVssChannelTbl, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | |
|
| | | _HttpSrvRetRecieve.setInfo("^/updateVssChannelTbl$", "POST",
|
| | | std::bind(&VssChannelTblController::updateVssChannelTbl, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | |
|
| | | _HttpSrvRetRecieve.setInfo("^/findVssChannelTbl$", "POST",
|
| | | std::bind(&VssChannelTblController::findVssChannelTbl, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | |
|
| | | _HttpSrvRetRecieve.setInfo("^/findVssChannelTblList$", "POST",
|
| | | std::bind(&VssChannelTblController::findVssChannelTblList, this,
|
| | | std::placeholders::_1, std::placeholders::_2,
|
| | | std::placeholders::_3, std::placeholders::_4));
|
| | |
|
| | | }
|
| | | public:
|
| | | /** 添加创建二级设备表 */
|
| | | /** 添加创建二级设备表 */
|
| | | std::string addVssChannelTbl(std::string ip, unsigned int port, std::string content, PResponse &response) {
|
| | | Json::Reader requestJsonReader;
|
| | | Json::Value requestJsonValue;
|
| | |
| | | responseJsonValue["success"] = "false";
|
| | | if (requestJsonReader.parse(content, requestJsonValue)) {
|
| | | VssChannelTblBuilder vssChannelTblBuilder;
|
| | | |
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | |
|
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | | if (iDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addID(iDJsonValue.asInt());
|
| | | vssChannelTblBuilder.addID(std::stoi((iDJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value devPubIDJsonValue = requestJsonValue[VssChannelTbl_DevPubID];
|
| | |
|
| | | Json::Value devPubIDJsonValue = requestJsonValue[VssChannelTbl_DevPubID];
|
| | | if (devPubIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDevPubID(devPubIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addDevPubID((devPubIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value nicknameJsonValue = requestJsonValue[VssChannelTbl_Nickname];
|
| | |
|
| | | Json::Value nicknameJsonValue = requestJsonValue[VssChannelTbl_Nickname];
|
| | | if (nicknameJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addNickname(nicknameJsonValue.asString());
|
| | | vssChannelTblBuilder.addNickname((nicknameJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value chanPubIDJsonValue = requestJsonValue[VssChannelTbl_ChanPubID];
|
| | |
|
| | | Json::Value chanPubIDJsonValue = requestJsonValue[VssChannelTbl_ChanPubID];
|
| | | if (chanPubIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addChanPubID(chanPubIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addChanPubID((chanPubIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value aliveJsonValue = requestJsonValue[VssChannelTbl_Alive];
|
| | |
|
| | | Json::Value aliveJsonValue = requestJsonValue[VssChannelTbl_Alive];
|
| | | if (aliveJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAlive(aliveJsonValue.asInt());
|
| | | vssChannelTblBuilder.addAlive(std::stoi((aliveJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value corpIDJsonValue = requestJsonValue[VssChannelTbl_CorpID];
|
| | |
|
| | | Json::Value corpIDJsonValue = requestJsonValue[VssChannelTbl_CorpID];
|
| | | if (corpIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addCorpID(corpIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addCorpID((corpIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value modelJsonValue = requestJsonValue[VssChannelTbl_Model];
|
| | |
|
| | | Json::Value modelJsonValue = requestJsonValue[VssChannelTbl_Model];
|
| | | if (modelJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addModel(modelJsonValue.asString());
|
| | | vssChannelTblBuilder.addModel((modelJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value ownerJsonValue = requestJsonValue[VssChannelTbl_Owner];
|
| | |
|
| | | Json::Value ownerJsonValue = requestJsonValue[VssChannelTbl_Owner];
|
| | | if (ownerJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addOwner(ownerJsonValue.asString());
|
| | | vssChannelTblBuilder.addOwner((ownerJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value civilCodeJsonValue = requestJsonValue[VssChannelTbl_CivilCode];
|
| | |
|
| | | Json::Value civilCodeJsonValue = requestJsonValue[VssChannelTbl_CivilCode];
|
| | | if (civilCodeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addCivilCode(civilCodeJsonValue.asString());
|
| | | vssChannelTblBuilder.addCivilCode((civilCodeJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value addressJsonValue = requestJsonValue[VssChannelTbl_Address];
|
| | |
|
| | | Json::Value addressJsonValue = requestJsonValue[VssChannelTbl_Address];
|
| | | if (addressJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAddress(addressJsonValue.asString());
|
| | | vssChannelTblBuilder.addAddress((addressJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value parentalJsonValue = requestJsonValue[VssChannelTbl_Parental];
|
| | |
|
| | | Json::Value parentalJsonValue = requestJsonValue[VssChannelTbl_Parental];
|
| | | if (parentalJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addParental(parentalJsonValue.asInt());
|
| | | vssChannelTblBuilder.addParental(std::stoi((parentalJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value parentIdJsonValue = requestJsonValue[VssChannelTbl_ParentId];
|
| | |
|
| | | Json::Value parentIdJsonValue = requestJsonValue[VssChannelTbl_ParentId];
|
| | | if (parentIdJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addParentId(parentIdJsonValue.asString());
|
| | | vssChannelTblBuilder.addParentId((parentIdJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value iPJsonValue = requestJsonValue[VssChannelTbl_IP];
|
| | |
|
| | | Json::Value iPJsonValue = requestJsonValue[VssChannelTbl_IP];
|
| | | if (iPJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addIP(iPJsonValue.asString());
|
| | | vssChannelTblBuilder.addIP((iPJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value portJsonValue = requestJsonValue[VssChannelTbl_Port];
|
| | |
|
| | | Json::Value portJsonValue = requestJsonValue[VssChannelTbl_Port];
|
| | | if (portJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addPort(portJsonValue.asInt());
|
| | | vssChannelTblBuilder.addPort(std::stoi((portJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value longitudeJsonValue = requestJsonValue[VssChannelTbl_Longitude];
|
| | |
|
| | | Json::Value longitudeJsonValue = requestJsonValue[VssChannelTbl_Longitude];
|
| | | if (longitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addLongitude(longitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addLongitude(std::stod((longitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value latitudeJsonValue = requestJsonValue[VssChannelTbl_Latitude];
|
| | |
|
| | | Json::Value latitudeJsonValue = requestJsonValue[VssChannelTbl_Latitude];
|
| | | if (latitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addLatitude(latitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addLatitude(std::stod((latitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value altitudeJsonValue = requestJsonValue[VssChannelTbl_Altitude];
|
| | |
|
| | | Json::Value altitudeJsonValue = requestJsonValue[VssChannelTbl_Altitude];
|
| | | if (altitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAltitude(altitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addAltitude(std::stod((altitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value pTZTypeJsonValue = requestJsonValue[VssChannelTbl_PTZType];
|
| | |
|
| | | Json::Value pTZTypeJsonValue = requestJsonValue[VssChannelTbl_PTZType];
|
| | | if (pTZTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addPTZType(pTZTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addPTZType(std::stoi((pTZTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value roomTypeJsonValue = requestJsonValue[VssChannelTbl_RoomType];
|
| | |
|
| | | Json::Value roomTypeJsonValue = requestJsonValue[VssChannelTbl_RoomType];
|
| | | if (roomTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addRoomType(roomTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addRoomType(std::stoi((roomTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value directionTypeJsonValue = requestJsonValue[VssChannelTbl_DirectionType];
|
| | |
|
| | | Json::Value directionTypeJsonValue = requestJsonValue[VssChannelTbl_DirectionType];
|
| | | if (directionTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDirectionType(directionTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addDirectionType(std::stoi((directionTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value streamTypeJsonValue = requestJsonValue[VssChannelTbl_StreamType];
|
| | |
|
| | | Json::Value streamTypeJsonValue = requestJsonValue[VssChannelTbl_StreamType];
|
| | | if (streamTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addStreamType(streamTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addStreamType(std::stoi((streamTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value dMarkerJsonValue = requestJsonValue[VssChannelTbl_DMarker];
|
| | |
|
| | | Json::Value dMarkerJsonValue = requestJsonValue[VssChannelTbl_DMarker];
|
| | | if (dMarkerJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDMarker(dMarkerJsonValue.asInt());
|
| | | vssChannelTblBuilder.addDMarker(std::stoi((dMarkerJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value updateTimeJsonValue = requestJsonValue[VssChannelTbl_UpdateTime];
|
| | |
|
| | | Json::Value updateTimeJsonValue = requestJsonValue[VssChannelTbl_UpdateTime];
|
| | | if (updateTimeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addUpdateTime(updateTimeJsonValue.asString());
|
| | | vssChannelTblBuilder.addUpdateTime((updateTimeJsonValue.asString()));
|
| | | }
|
| | | auto keyValuesToAdd = vssChannelTblBuilder.buildVssChannelTblMap();
|
| | | if (keyValuesToAdd.size() > 0) {
|
| | | mysqlpp::SimpleResult addVssChannelTblResult = VssChannelTblDao::instance()->addVssChannelTbl(keyValuesToAdd);
|
| | | if (addVssChannelTblResult.rows() > 0) {
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "添加成功!";
|
| | | }
|
| | | auto keyValuesToAdd = vssChannelTblBuilder.buildVssChannelTblMap();
|
| | | if (keyValuesToAdd.size() > 0) {
|
| | | mysqlpp::SimpleResult addVssChannelTblResult = VssChannelTblDao::instance()->addVssChannelTbl(keyValuesToAdd);
|
| | | if (addVssChannelTblResult.rows() > 0) {
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "添加成功!";
|
| | | }
|
| | | }
|
| | | }
|
| | | return responseJsonValue.toStyledString();
|
| | | }
|
| | | |
| | |
|
| | | /** 删除创建二级设备表 */
|
| | | std::string delVssChannelTbl(std::string ip, unsigned int port, std::string content, PResponse &response) {
|
| | | Json::Reader requestJsonReader;
|
| | |
| | | responseJsonValue["message"] = "删除失败!";
|
| | | responseJsonValue["success"] = "false";
|
| | | if (requestJsonReader.parse(content, requestJsonValue)) {
|
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | | if (iDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | string iDValue = iDJsonValue.asString();
|
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | | if (iDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | string iDValue = iDJsonValue.asString();
|
| | | if (iDValue.size() > 0 && VssChannelTblDao::instance()->deleteByColumn("ID", iDValue)) {
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "删除成功!";
|
| | | }
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "删除成功!";
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | return responseJsonValue.toStyledString();
|
| | | }
|
| | | |
| | |
|
| | | /** 更新创建二级设备表 */
|
| | | std::string updateVssChannelTbl(std::string ip, unsigned int port, std::string content, PResponse &response) {
|
| | | Json::Reader requestJsonReader;
|
| | |
| | | responseJsonValue["success"] = "false";
|
| | | if (requestJsonReader.parse(content, requestJsonValue)) {
|
| | | VssChannelTblBuilder vssChannelTblBuilder;
|
| | | |
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | |
|
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | | if (iDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addID(iDJsonValue.asInt());
|
| | | vssChannelTblBuilder.addID(std::stoi((iDJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value devPubIDJsonValue = requestJsonValue[VssChannelTbl_DevPubID];
|
| | |
|
| | | Json::Value devPubIDJsonValue = requestJsonValue[VssChannelTbl_DevPubID];
|
| | | if (devPubIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDevPubID(devPubIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addDevPubID((devPubIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value nicknameJsonValue = requestJsonValue[VssChannelTbl_Nickname];
|
| | |
|
| | | Json::Value nicknameJsonValue = requestJsonValue[VssChannelTbl_Nickname];
|
| | | if (nicknameJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addNickname(nicknameJsonValue.asString());
|
| | | vssChannelTblBuilder.addNickname((nicknameJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value chanPubIDJsonValue = requestJsonValue[VssChannelTbl_ChanPubID];
|
| | |
|
| | | Json::Value chanPubIDJsonValue = requestJsonValue[VssChannelTbl_ChanPubID];
|
| | | if (chanPubIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addChanPubID(chanPubIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addChanPubID((chanPubIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value aliveJsonValue = requestJsonValue[VssChannelTbl_Alive];
|
| | |
|
| | | Json::Value aliveJsonValue = requestJsonValue[VssChannelTbl_Alive];
|
| | | if (aliveJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAlive(aliveJsonValue.asInt());
|
| | | vssChannelTblBuilder.addAlive(std::stoi((aliveJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value corpIDJsonValue = requestJsonValue[VssChannelTbl_CorpID];
|
| | |
|
| | | Json::Value corpIDJsonValue = requestJsonValue[VssChannelTbl_CorpID];
|
| | | if (corpIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addCorpID(corpIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addCorpID((corpIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value modelJsonValue = requestJsonValue[VssChannelTbl_Model];
|
| | |
|
| | | Json::Value modelJsonValue = requestJsonValue[VssChannelTbl_Model];
|
| | | if (modelJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addModel(modelJsonValue.asString());
|
| | | vssChannelTblBuilder.addModel((modelJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value ownerJsonValue = requestJsonValue[VssChannelTbl_Owner];
|
| | |
|
| | | Json::Value ownerJsonValue = requestJsonValue[VssChannelTbl_Owner];
|
| | | if (ownerJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addOwner(ownerJsonValue.asString());
|
| | | vssChannelTblBuilder.addOwner((ownerJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value civilCodeJsonValue = requestJsonValue[VssChannelTbl_CivilCode];
|
| | |
|
| | | Json::Value civilCodeJsonValue = requestJsonValue[VssChannelTbl_CivilCode];
|
| | | if (civilCodeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addCivilCode(civilCodeJsonValue.asString());
|
| | | vssChannelTblBuilder.addCivilCode((civilCodeJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value addressJsonValue = requestJsonValue[VssChannelTbl_Address];
|
| | |
|
| | | Json::Value addressJsonValue = requestJsonValue[VssChannelTbl_Address];
|
| | | if (addressJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAddress(addressJsonValue.asString());
|
| | | vssChannelTblBuilder.addAddress((addressJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value parentalJsonValue = requestJsonValue[VssChannelTbl_Parental];
|
| | |
|
| | | Json::Value parentalJsonValue = requestJsonValue[VssChannelTbl_Parental];
|
| | | if (parentalJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addParental(parentalJsonValue.asInt());
|
| | | vssChannelTblBuilder.addParental(std::stoi((parentalJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value parentIdJsonValue = requestJsonValue[VssChannelTbl_ParentId];
|
| | |
|
| | | Json::Value parentIdJsonValue = requestJsonValue[VssChannelTbl_ParentId];
|
| | | if (parentIdJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addParentId(parentIdJsonValue.asString());
|
| | | vssChannelTblBuilder.addParentId((parentIdJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value iPJsonValue = requestJsonValue[VssChannelTbl_IP];
|
| | |
|
| | | Json::Value iPJsonValue = requestJsonValue[VssChannelTbl_IP];
|
| | | if (iPJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addIP(iPJsonValue.asString());
|
| | | vssChannelTblBuilder.addIP((iPJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value portJsonValue = requestJsonValue[VssChannelTbl_Port];
|
| | |
|
| | | Json::Value portJsonValue = requestJsonValue[VssChannelTbl_Port];
|
| | | if (portJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addPort(portJsonValue.asInt());
|
| | | vssChannelTblBuilder.addPort(std::stoi((portJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value longitudeJsonValue = requestJsonValue[VssChannelTbl_Longitude];
|
| | |
|
| | | Json::Value longitudeJsonValue = requestJsonValue[VssChannelTbl_Longitude];
|
| | | if (longitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addLongitude(longitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addLongitude(std::stod((longitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value latitudeJsonValue = requestJsonValue[VssChannelTbl_Latitude];
|
| | |
|
| | | Json::Value latitudeJsonValue = requestJsonValue[VssChannelTbl_Latitude];
|
| | | if (latitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addLatitude(latitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addLatitude(std::stod((latitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value altitudeJsonValue = requestJsonValue[VssChannelTbl_Altitude];
|
| | |
|
| | | Json::Value altitudeJsonValue = requestJsonValue[VssChannelTbl_Altitude];
|
| | | if (altitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAltitude(altitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addAltitude(std::stod((altitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value pTZTypeJsonValue = requestJsonValue[VssChannelTbl_PTZType];
|
| | |
|
| | | Json::Value pTZTypeJsonValue = requestJsonValue[VssChannelTbl_PTZType];
|
| | | if (pTZTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addPTZType(pTZTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addPTZType(std::stoi((pTZTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value roomTypeJsonValue = requestJsonValue[VssChannelTbl_RoomType];
|
| | |
|
| | | Json::Value roomTypeJsonValue = requestJsonValue[VssChannelTbl_RoomType];
|
| | | if (roomTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addRoomType(roomTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addRoomType(std::stoi((roomTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value directionTypeJsonValue = requestJsonValue[VssChannelTbl_DirectionType];
|
| | |
|
| | | Json::Value directionTypeJsonValue = requestJsonValue[VssChannelTbl_DirectionType];
|
| | | if (directionTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDirectionType(directionTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addDirectionType(std::stoi((directionTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value streamTypeJsonValue = requestJsonValue[VssChannelTbl_StreamType];
|
| | |
|
| | | Json::Value streamTypeJsonValue = requestJsonValue[VssChannelTbl_StreamType];
|
| | | if (streamTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addStreamType(streamTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addStreamType(std::stoi((streamTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value dMarkerJsonValue = requestJsonValue[VssChannelTbl_DMarker];
|
| | |
|
| | | Json::Value dMarkerJsonValue = requestJsonValue[VssChannelTbl_DMarker];
|
| | | if (dMarkerJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDMarker(dMarkerJsonValue.asInt());
|
| | | vssChannelTblBuilder.addDMarker(std::stoi((dMarkerJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value updateTimeJsonValue = requestJsonValue[VssChannelTbl_UpdateTime];
|
| | |
|
| | | Json::Value updateTimeJsonValue = requestJsonValue[VssChannelTbl_UpdateTime];
|
| | | if (updateTimeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addUpdateTime(updateTimeJsonValue.asString());
|
| | | vssChannelTblBuilder.addUpdateTime((updateTimeJsonValue.asString()));
|
| | | }
|
| | | if (iDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | string iDValue = iDJsonValue.asString();
|
| | | if (iDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | string iDValue = iDJsonValue.asString();
|
| | | if (iDValue.size() > 0 && VssChannelTblDao::instance()->updateVssChannelTbl(vssChannelTblBuilder.buildVssChannelTblMap(), "ID", iDValue)) {
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "更新成功!";
|
| | | }
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "更新成功!";
|
| | | }
|
| | | }
|
| | | }
|
| | | return responseJsonValue.toStyledString();
|
| | | }
|
| | | |
| | |
|
| | | /** 查找单个创建二级设备表 */
|
| | | std::string findVssChannelTbl(std::string ip, unsigned int port, std::string content, PResponse &response) {
|
| | | Json::Reader requestJsonReader;
|
| | |
| | | responseJsonValue["success"] = "false";
|
| | | if (requestJsonReader.parse(content, requestJsonValue)) {
|
| | | VssChannelTblBuilder vssChannelTblBuilder;
|
| | | |
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | |
|
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | | if (iDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addID(iDJsonValue.asInt());
|
| | | vssChannelTblBuilder.addID(std::stoi((iDJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value devPubIDJsonValue = requestJsonValue[VssChannelTbl_DevPubID];
|
| | |
|
| | | Json::Value devPubIDJsonValue = requestJsonValue[VssChannelTbl_DevPubID];
|
| | | if (devPubIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDevPubID(devPubIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addDevPubID((devPubIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value nicknameJsonValue = requestJsonValue[VssChannelTbl_Nickname];
|
| | |
|
| | | Json::Value nicknameJsonValue = requestJsonValue[VssChannelTbl_Nickname];
|
| | | if (nicknameJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addNickname(nicknameJsonValue.asString());
|
| | | vssChannelTblBuilder.addNickname((nicknameJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value chanPubIDJsonValue = requestJsonValue[VssChannelTbl_ChanPubID];
|
| | |
|
| | | Json::Value chanPubIDJsonValue = requestJsonValue[VssChannelTbl_ChanPubID];
|
| | | if (chanPubIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addChanPubID(chanPubIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addChanPubID((chanPubIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value aliveJsonValue = requestJsonValue[VssChannelTbl_Alive];
|
| | |
|
| | | Json::Value aliveJsonValue = requestJsonValue[VssChannelTbl_Alive];
|
| | | if (aliveJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAlive(aliveJsonValue.asInt());
|
| | | vssChannelTblBuilder.addAlive(std::stoi((aliveJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value corpIDJsonValue = requestJsonValue[VssChannelTbl_CorpID];
|
| | |
|
| | | Json::Value corpIDJsonValue = requestJsonValue[VssChannelTbl_CorpID];
|
| | | if (corpIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addCorpID(corpIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addCorpID((corpIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value modelJsonValue = requestJsonValue[VssChannelTbl_Model];
|
| | |
|
| | | Json::Value modelJsonValue = requestJsonValue[VssChannelTbl_Model];
|
| | | if (modelJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addModel(modelJsonValue.asString());
|
| | | vssChannelTblBuilder.addModel((modelJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value ownerJsonValue = requestJsonValue[VssChannelTbl_Owner];
|
| | |
|
| | | Json::Value ownerJsonValue = requestJsonValue[VssChannelTbl_Owner];
|
| | | if (ownerJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addOwner(ownerJsonValue.asString());
|
| | | vssChannelTblBuilder.addOwner((ownerJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value civilCodeJsonValue = requestJsonValue[VssChannelTbl_CivilCode];
|
| | |
|
| | | Json::Value civilCodeJsonValue = requestJsonValue[VssChannelTbl_CivilCode];
|
| | | if (civilCodeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addCivilCode(civilCodeJsonValue.asString());
|
| | | vssChannelTblBuilder.addCivilCode((civilCodeJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value addressJsonValue = requestJsonValue[VssChannelTbl_Address];
|
| | |
|
| | | Json::Value addressJsonValue = requestJsonValue[VssChannelTbl_Address];
|
| | | if (addressJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAddress(addressJsonValue.asString());
|
| | | vssChannelTblBuilder.addAddress((addressJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value parentalJsonValue = requestJsonValue[VssChannelTbl_Parental];
|
| | |
|
| | | Json::Value parentalJsonValue = requestJsonValue[VssChannelTbl_Parental];
|
| | | if (parentalJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addParental(parentalJsonValue.asInt());
|
| | | vssChannelTblBuilder.addParental(std::stoi((parentalJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value parentIdJsonValue = requestJsonValue[VssChannelTbl_ParentId];
|
| | |
|
| | | Json::Value parentIdJsonValue = requestJsonValue[VssChannelTbl_ParentId];
|
| | | if (parentIdJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addParentId(parentIdJsonValue.asString());
|
| | | vssChannelTblBuilder.addParentId((parentIdJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value iPJsonValue = requestJsonValue[VssChannelTbl_IP];
|
| | |
|
| | | Json::Value iPJsonValue = requestJsonValue[VssChannelTbl_IP];
|
| | | if (iPJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addIP(iPJsonValue.asString());
|
| | | vssChannelTblBuilder.addIP((iPJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value portJsonValue = requestJsonValue[VssChannelTbl_Port];
|
| | |
|
| | | Json::Value portJsonValue = requestJsonValue[VssChannelTbl_Port];
|
| | | if (portJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addPort(portJsonValue.asInt());
|
| | | vssChannelTblBuilder.addPort(std::stoi((portJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value longitudeJsonValue = requestJsonValue[VssChannelTbl_Longitude];
|
| | |
|
| | | Json::Value longitudeJsonValue = requestJsonValue[VssChannelTbl_Longitude];
|
| | | if (longitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addLongitude(longitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addLongitude(std::stod((longitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value latitudeJsonValue = requestJsonValue[VssChannelTbl_Latitude];
|
| | |
|
| | | Json::Value latitudeJsonValue = requestJsonValue[VssChannelTbl_Latitude];
|
| | | if (latitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addLatitude(latitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addLatitude(std::stod((latitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value altitudeJsonValue = requestJsonValue[VssChannelTbl_Altitude];
|
| | |
|
| | | Json::Value altitudeJsonValue = requestJsonValue[VssChannelTbl_Altitude];
|
| | | if (altitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAltitude(altitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addAltitude(std::stod((altitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value pTZTypeJsonValue = requestJsonValue[VssChannelTbl_PTZType];
|
| | |
|
| | | Json::Value pTZTypeJsonValue = requestJsonValue[VssChannelTbl_PTZType];
|
| | | if (pTZTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addPTZType(pTZTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addPTZType(std::stoi((pTZTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value roomTypeJsonValue = requestJsonValue[VssChannelTbl_RoomType];
|
| | |
|
| | | Json::Value roomTypeJsonValue = requestJsonValue[VssChannelTbl_RoomType];
|
| | | if (roomTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addRoomType(roomTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addRoomType(std::stoi((roomTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value directionTypeJsonValue = requestJsonValue[VssChannelTbl_DirectionType];
|
| | |
|
| | | Json::Value directionTypeJsonValue = requestJsonValue[VssChannelTbl_DirectionType];
|
| | | if (directionTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDirectionType(directionTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addDirectionType(std::stoi((directionTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value streamTypeJsonValue = requestJsonValue[VssChannelTbl_StreamType];
|
| | |
|
| | | Json::Value streamTypeJsonValue = requestJsonValue[VssChannelTbl_StreamType];
|
| | | if (streamTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addStreamType(streamTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addStreamType(std::stoi((streamTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value dMarkerJsonValue = requestJsonValue[VssChannelTbl_DMarker];
|
| | |
|
| | | Json::Value dMarkerJsonValue = requestJsonValue[VssChannelTbl_DMarker];
|
| | | if (dMarkerJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDMarker(dMarkerJsonValue.asInt());
|
| | | vssChannelTblBuilder.addDMarker(std::stoi((dMarkerJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value updateTimeJsonValue = requestJsonValue[VssChannelTbl_UpdateTime];
|
| | |
|
| | | Json::Value updateTimeJsonValue = requestJsonValue[VssChannelTbl_UpdateTime];
|
| | | if (updateTimeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addUpdateTime(updateTimeJsonValue.asString());
|
| | | vssChannelTblBuilder.addUpdateTime((updateTimeJsonValue.asString()));
|
| | | }
|
| | | responseJsonValue["message"] = "查询成功!";
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["data"] = VssChannelTblDao::instance()->findJsonArray(string("select * from ") + VSSChannelTbl_TABLE_NAME + " where 1 = 1 limit 1");
|
| | | responseJsonValue["message"] = "查询成功!";
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["data"] = VssChannelTblDao::instance()->findJsonArray(string("select * from ") + VSSChannelTbl_TABLE_NAME + " where 1 = 1 limit 1");
|
| | | }
|
| | | return responseJsonValue.toStyledString();
|
| | | }
|
| | | |
| | |
|
| | | /** 查找创建二级设备表列表 */
|
| | | std::string findVssChannelTblList(std::string ip, unsigned int port, std::string content, PResponse &response) {
|
| | | Json::Reader requestJsonReader;
|
| | |
| | | responseJsonValue["success"] = "false";
|
| | | if (content == "" || requestJsonReader.parse(content, requestJsonValue)) {
|
| | | VssChannelTblBuilder vssChannelTblBuilder;
|
| | | |
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | |
|
| | | Json::Value iDJsonValue = requestJsonValue[VssChannelTbl_ID];
|
| | | if (iDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addID(iDJsonValue.asInt());
|
| | | vssChannelTblBuilder.addID(std::stoi((iDJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value devPubIDJsonValue = requestJsonValue[VssChannelTbl_DevPubID];
|
| | |
|
| | | Json::Value devPubIDJsonValue = requestJsonValue[VssChannelTbl_DevPubID];
|
| | | if (devPubIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDevPubID(devPubIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addDevPubID((devPubIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value nicknameJsonValue = requestJsonValue[VssChannelTbl_Nickname];
|
| | |
|
| | | Json::Value nicknameJsonValue = requestJsonValue[VssChannelTbl_Nickname];
|
| | | if (nicknameJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addNickname(nicknameJsonValue.asString());
|
| | | vssChannelTblBuilder.addNickname((nicknameJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value chanPubIDJsonValue = requestJsonValue[VssChannelTbl_ChanPubID];
|
| | |
|
| | | Json::Value chanPubIDJsonValue = requestJsonValue[VssChannelTbl_ChanPubID];
|
| | | if (chanPubIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addChanPubID(chanPubIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addChanPubID((chanPubIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value aliveJsonValue = requestJsonValue[VssChannelTbl_Alive];
|
| | |
|
| | | Json::Value aliveJsonValue = requestJsonValue[VssChannelTbl_Alive];
|
| | | if (aliveJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAlive(aliveJsonValue.asInt());
|
| | | vssChannelTblBuilder.addAlive(std::stoi((aliveJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value corpIDJsonValue = requestJsonValue[VssChannelTbl_CorpID];
|
| | |
|
| | | Json::Value corpIDJsonValue = requestJsonValue[VssChannelTbl_CorpID];
|
| | | if (corpIDJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addCorpID(corpIDJsonValue.asString());
|
| | | vssChannelTblBuilder.addCorpID((corpIDJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value modelJsonValue = requestJsonValue[VssChannelTbl_Model];
|
| | |
|
| | | Json::Value modelJsonValue = requestJsonValue[VssChannelTbl_Model];
|
| | | if (modelJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addModel(modelJsonValue.asString());
|
| | | vssChannelTblBuilder.addModel((modelJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value ownerJsonValue = requestJsonValue[VssChannelTbl_Owner];
|
| | |
|
| | | Json::Value ownerJsonValue = requestJsonValue[VssChannelTbl_Owner];
|
| | | if (ownerJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addOwner(ownerJsonValue.asString());
|
| | | vssChannelTblBuilder.addOwner((ownerJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value civilCodeJsonValue = requestJsonValue[VssChannelTbl_CivilCode];
|
| | |
|
| | | Json::Value civilCodeJsonValue = requestJsonValue[VssChannelTbl_CivilCode];
|
| | | if (civilCodeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addCivilCode(civilCodeJsonValue.asString());
|
| | | vssChannelTblBuilder.addCivilCode((civilCodeJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value addressJsonValue = requestJsonValue[VssChannelTbl_Address];
|
| | |
|
| | | Json::Value addressJsonValue = requestJsonValue[VssChannelTbl_Address];
|
| | | if (addressJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAddress(addressJsonValue.asString());
|
| | | vssChannelTblBuilder.addAddress((addressJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value parentalJsonValue = requestJsonValue[VssChannelTbl_Parental];
|
| | |
|
| | | Json::Value parentalJsonValue = requestJsonValue[VssChannelTbl_Parental];
|
| | | if (parentalJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addParental(parentalJsonValue.asInt());
|
| | | vssChannelTblBuilder.addParental(std::stoi((parentalJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value parentIdJsonValue = requestJsonValue[VssChannelTbl_ParentId];
|
| | |
|
| | | Json::Value parentIdJsonValue = requestJsonValue[VssChannelTbl_ParentId];
|
| | | if (parentIdJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addParentId(parentIdJsonValue.asString());
|
| | | vssChannelTblBuilder.addParentId((parentIdJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value iPJsonValue = requestJsonValue[VssChannelTbl_IP];
|
| | |
|
| | | Json::Value iPJsonValue = requestJsonValue[VssChannelTbl_IP];
|
| | | if (iPJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addIP(iPJsonValue.asString());
|
| | | vssChannelTblBuilder.addIP((iPJsonValue.asString()));
|
| | | }
|
| | | |
| | | Json::Value portJsonValue = requestJsonValue[VssChannelTbl_Port];
|
| | |
|
| | | Json::Value portJsonValue = requestJsonValue[VssChannelTbl_Port];
|
| | | if (portJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addPort(portJsonValue.asInt());
|
| | | vssChannelTblBuilder.addPort(std::stoi((portJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value longitudeJsonValue = requestJsonValue[VssChannelTbl_Longitude];
|
| | |
|
| | | Json::Value longitudeJsonValue = requestJsonValue[VssChannelTbl_Longitude];
|
| | | if (longitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addLongitude(longitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addLongitude(std::stod((longitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value latitudeJsonValue = requestJsonValue[VssChannelTbl_Latitude];
|
| | |
|
| | | Json::Value latitudeJsonValue = requestJsonValue[VssChannelTbl_Latitude];
|
| | | if (latitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addLatitude(latitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addLatitude(std::stod((latitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value altitudeJsonValue = requestJsonValue[VssChannelTbl_Altitude];
|
| | |
|
| | | Json::Value altitudeJsonValue = requestJsonValue[VssChannelTbl_Altitude];
|
| | | if (altitudeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addAltitude(altitudeJsonValue.asDouble());
|
| | | vssChannelTblBuilder.addAltitude(std::stod((altitudeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value pTZTypeJsonValue = requestJsonValue[VssChannelTbl_PTZType];
|
| | |
|
| | | Json::Value pTZTypeJsonValue = requestJsonValue[VssChannelTbl_PTZType];
|
| | | if (pTZTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addPTZType(pTZTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addPTZType(std::stoi((pTZTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value roomTypeJsonValue = requestJsonValue[VssChannelTbl_RoomType];
|
| | |
|
| | | Json::Value roomTypeJsonValue = requestJsonValue[VssChannelTbl_RoomType];
|
| | | if (roomTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addRoomType(roomTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addRoomType(std::stoi((roomTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value directionTypeJsonValue = requestJsonValue[VssChannelTbl_DirectionType];
|
| | |
|
| | | Json::Value directionTypeJsonValue = requestJsonValue[VssChannelTbl_DirectionType];
|
| | | if (directionTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDirectionType(directionTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addDirectionType(std::stoi((directionTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value streamTypeJsonValue = requestJsonValue[VssChannelTbl_StreamType];
|
| | |
|
| | | Json::Value streamTypeJsonValue = requestJsonValue[VssChannelTbl_StreamType];
|
| | | if (streamTypeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addStreamType(streamTypeJsonValue.asInt());
|
| | | vssChannelTblBuilder.addStreamType(std::stoi((streamTypeJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value dMarkerJsonValue = requestJsonValue[VssChannelTbl_DMarker];
|
| | |
|
| | | Json::Value dMarkerJsonValue = requestJsonValue[VssChannelTbl_DMarker];
|
| | | if (dMarkerJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addDMarker(dMarkerJsonValue.asInt());
|
| | | vssChannelTblBuilder.addDMarker(std::stoi((dMarkerJsonValue.asString())));
|
| | | }
|
| | | |
| | | Json::Value updateTimeJsonValue = requestJsonValue[VssChannelTbl_UpdateTime];
|
| | |
|
| | | Json::Value updateTimeJsonValue = requestJsonValue[VssChannelTbl_UpdateTime];
|
| | | if (updateTimeJsonValue.type() != Json::ValueType::nullValue) {
|
| | | vssChannelTblBuilder.addUpdateTime(updateTimeJsonValue.asString());
|
| | | vssChannelTblBuilder.addUpdateTime((updateTimeJsonValue.asString()));
|
| | | }
|
| | | responseJsonValue["message"] = "查询成功!";
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["data"] = VssChannelTblDao::instance()->findJsonArray(string("select * from ") + VSSChannelTbl_TABLE_NAME + " where 1 = 1");
|
| | | responseJsonValue["message"] = "查询成功!";
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["data"] = VssChannelTblDao::instance()->findJsonArray(string("select * from ") + VSSChannelTbl_TABLE_NAME + " where 1 = 1");
|
| | |
|
| | | }
|
| | | return responseJsonValue.toStyledString();
|