From 71156fd4aaa5f18ba9f95f9f08bc930a321e257c Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期一, 16 一月 2023 11:26:58 +0800
Subject: [PATCH] 完善摄像机接口, 增加实时轮询参数

---
 camera.cpp |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/camera.cpp b/camera.cpp
index 56e85ce..638d4d2 100644
--- a/camera.cpp
+++ b/camera.cpp
@@ -56,19 +56,16 @@
 using namespace protomsg;
 
 // 鍔爂et鍙傛暟 runType 1: 瀹炴椂 0 杞
-bool dbapi_get_cameras_by_runtype(void *handle, std::vector<protomsg::Camera> &list) {
+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)");
+    }
 
-    bool ret = bus_dbapi_get_list(handle, topic, list);
+    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);
-
-    return ret;
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0