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

---
 rule.cpp |   42 +++++++++++++++++++++++++++++++++---------
 1 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/rule.cpp b/rule.cpp
index 2c5e94a..9215e4a 100644
--- a/rule.cpp
+++ b/rule.cpp
@@ -1,21 +1,45 @@
+#include "3rdparty/yyjson/yyjson.h"
 #include "dbapi.h"
 #include "util.h"
-#include "3rdparty/yyjson/yyjson.h"
 
 using namespace protomsg;
 
-bool dbapi_get_time_rules(void *handle, std::vector<protomsg::CameraTimerule> & list){
-    const char *topic = DATA_URL_PREFIX("/cameraTimerule/findAll");	
+bool dbapi_get_time_rules(void *handle, std::vector<protomsg::CameraTimerule> &list) {
+    const char *topic = DATA_URL_PREFIX("/cameraTimerule/findAll");
 
-	bool ret = bus_dbapi_get_list(handle, topic, list);
-	return ret;
+    bool ret = bus_dbapi_get_list(handle, topic, list);
+
+    return ret;
 }
 
+bool dbapi_get_dayctls(char *timeRules, std::vector<protomsg::DayCtl> & list)
+{
+    const char * flag_key = NULL;
 
-bool dbapi_get_camera_rules(void *handle, std::vector<protomsg::CameraAndRules> & list) {
+    const char * data_key = "time_rule";
+
+	bool ret = bus_dbapi_get_list(timeRules, flag_key, data_key, list);
+
+    return ret;
+
+}
+
+bool dbapi_get_timeranges(char *datactls, std::vector<protomsg::TimeRange> & list)
+{
+    const char * flag_key = NULL;
+
+    const char * data_key = "time_range";
+
+	bool ret = bus_dbapi_get_list(datactls, flag_key, data_key, list);
+
+    return ret;
+
+}
+
+bool dbapi_get_camera_rules(void *handle, std::vector<protomsg::CameraAndRules> &list) {
     const char *topic = DATA_URL_PREFIX("/camera/rule/findAll");
 
-	bool ret = bus_dbapi_get_list(handle, topic, list);
-    return true;;
-}
+    bool ret = bus_dbapi_get_list(handle, topic, list);
 
+    return true;
+}

--
Gitblit v1.8.0