From 382be0b170230274bb18c66dd42146b255d7245a Mon Sep 17 00:00:00 2001 From: cheliequan <liequanche@126.com> Date: 星期一, 16 一月 2023 15:40:47 +0800 Subject: [PATCH] 修改头文件搜索目录和cpollcontrol统一 --- rule.cpp | 39 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 37 insertions(+), 2 deletions(-) diff --git a/rule.cpp b/rule.cpp index df571c1..9215e4a 100644 --- a/rule.cpp +++ b/rule.cpp @@ -1,10 +1,45 @@ -#include "rule.h" +#include "3rdparty/yyjson/yyjson.h" +#include "dbapi.h" #include "util.h" using namespace protomsg; -bool dbapi_get_time_rules(void *handle, vector<protomsg::CameraTimerule> & list) { +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 dbapi_get_dayctls(char *timeRules, std::vector<protomsg::DayCtl> & list) +{ + const char * flag_key = NULL; + + 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; } -- Gitblit v1.8.0