zhangzengfei
2023-01-16 71156fd4aaa5f18ba9f95f9f08bc930a321e257c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "3rdparty/yyjson/yyjson.h"
#include "dbapi.h"
#include "util.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 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;
}