From dccc1ca1304dc1fcb86c8e24edd491509269b3e7 Mon Sep 17 00:00:00 2001 From: cheliequan <liequanche@126.com> Date: 星期日, 29 一月 2023 14:44:52 +0800 Subject: [PATCH] 解决编译告警 --- camera.cpp | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/camera.cpp b/camera.cpp index 771ebbb..e02a8db 100644 --- a/camera.cpp +++ b/camera.cpp @@ -54,19 +54,26 @@ #include "dbapi.h" #include "util.h" using namespace protomsg; -// 鍔爂et鍙傛暟 runType 1: 瀹炴椂 0 杞 -bool dbapi_get_cameras_by_runtype(void *handle, std::vector<protomsg::Camera> & list) { - const char *topic = DATA_URL_PREFIX("/camera/getCamerasByRunType"); - bool ret = bus_dbapi_get_list(handle, topic, list); +// 鍔爂et鍙傛暟 runType 1: 瀹炴椂 0 杞 +bool dbapi_get_cameras_by_runType(void *handle, std::vector<protomsg::Camera> &list, char *runType, bool gb28181) { + const char *topic = DATA_URL_PREFIX("/camera/getCamerasByRunType"); + if (gb28181) { + topic = DATA_URL_PREFIX("/gb28181/camera/getCamerasByRunType)"); + } + + std::map<string, string> params; + params["runType"] = runType; + bool ret = bus_dbapi_get_list(handle, topic, list, params); + params.clear(); + return ret; } -// 鍔爂et鍙傛暟 runType 1: 瀹炴椂 0 杞 -bool dbapi_get_gb28181_cameras_by_runtype(void *handle, std::vector<protomsg::Camera> & list) { - const char *topic = DATA_URL_PREFIX("/gb28181/camera/getCamerasByRunType"); - bool ret = bus_dbapi_get_list(handle, topic, list); +bool dbapi_get_json_by_cameralist(std::vector<protomsg::Camera> &list, string &json) { + bool ret = bus_dbapi_get_json(list, json); + return ret; } -- Gitblit v1.8.0