1 /*
2  * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef HIAPPEVENT_FRAMEWORKS_NATIVE_LIB_HIAPPEVENT_CACHE_APP_EVENT_CACHE_COMMON_H
16 #define HIAPPEVENT_FRAMEWORKS_NATIVE_LIB_HIAPPEVENT_CACHE_APP_EVENT_CACHE_COMMON_H
17 
18 #include <string>
19 
20 namespace OHOS {
21 namespace HiviewDFX {
22 namespace AppEventCacheCommon {
23 constexpr int DB_SUCC = 0;
24 constexpr int DB_FAILED = -1;
25 const unsigned int HIAPPEVENT_DOMAIN = 0xD002D07;
26 
27 namespace Events {
28 const std::string TABLE = "events";
29 const std::string FIELD_SEQ = "seq";
30 const std::string FIELD_DOMAIN = "domain";
31 const std::string FIELD_NAME = "name";
32 const std::string FIELD_TYPE = "type";
33 const std::string FIELD_TIME = "time";
34 const std::string FIELD_TZ = "tz";
35 const std::string FIELD_PID = "pid";
36 const std::string FIELD_TID = "tid";
37 const std::string FIELD_TRACE_ID = "trace_id";
38 const std::string FIELD_SPAN_ID = "span_id";
39 const std::string FIELD_PSPAN_ID = "pspan_id";
40 const std::string FIELD_TRACE_FLAG = "trace_flag";
41 const std::string FIELD_PARAMS = "params";
42 const std::string FIELD_SIZE = "size";
43 const std::string FIELD_RUNNING_ID = "running_id";
44 } // namespace Events
45 
46 namespace Observers {
47 const std::string TABLE = "observers";
48 const std::string FIELD_SEQ = "seq";
49 const std::string FIELD_NAME = "name";
50 const std::string FIELD_HASH = "hash";
51 } // namespace Observers
52 
53 namespace AppEventMapping {
54 const std::string TABLE = "event_observer_mapping";
55 const std::string FIELD_SEQ = "seq";
56 const std::string FIELD_EVENT_SEQ = "event_seq";
57 const std::string FIELD_OBSERVER_SEQ = "observer_seq";
58 } // namespace AppEventMapping
59 
60 namespace UserIds {
61 const std::string TABLE = "user_ids";
62 const std::string FIELD_SEQ = "seq";
63 const std::string FIELD_NAME = "name";
64 const std::string FIELD_VALUE = "value";
65 } // namespace UserIds
66 
67 namespace UserProperties {
68 const std::string TABLE = "user_properties";
69 const std::string FIELD_SEQ = "seq";
70 const std::string FIELD_NAME = "name";
71 const std::string FIELD_VALUE = "value";
72 } // namespace UserProperties
73 
74 namespace CustomEventParams {
75 const std::string TABLE = "custom_event_params";
76 const std::string FIELD_SEQ = "seq";
77 const std::string FIELD_RUNNING_ID = "running_id";
78 const std::string FIELD_DOMAIN = "domain";
79 const std::string FIELD_NAME = "name";
80 const std::string FIELD_PARAM_KEY = "param_key";
81 const std::string FIELD_PARAM_VALUE = "param_value";
82 const std::string FIELD_PARAM_TYPE = "param_type";
83 } // namespace CustomEventParams
84 } // namespace AppEventCacheCommon
85 } // namespace HiviewDFX
86 } // namespace OHOS
87 #endif // HIAPPEVENT_FRAMEWORKS_NATIVE_LIB_HIAPPEVENT_CACHE_APP_EVENT_CACHE_COMMON_H
88