122 lines
3.5 KiB
Python
122 lines
3.5 KiB
Python
import json
|
|
|
|
|
|
class Config:
|
|
FIELD_MAP = {
|
|
"x01": "user_id",
|
|
"x02": "account_id",
|
|
"x03": "distinct_id",
|
|
"x04": "event_name",
|
|
"x05": "server_time",
|
|
"a01": "ip",
|
|
"a02": "country",
|
|
"a03": "country_code",
|
|
"a04": "province",
|
|
"a05": "city",
|
|
"a06": "os_version",
|
|
"a07": "manufacturer",
|
|
"a08": "os",
|
|
"a09": "device_id",
|
|
"a10": "screen_height",
|
|
"a11": "screen_width",
|
|
"a12": "device_model",
|
|
"a13": "app_version",
|
|
"a14": "bundle_id",
|
|
"a15": "lib",
|
|
"a16": "lib_version",
|
|
"a17": "network_type",
|
|
"a18": "carrier",
|
|
"a19": "browser",
|
|
"a20": "browser_version",
|
|
"a21": "duration",
|
|
"a22": "url",
|
|
"a23": "url_path",
|
|
"a24": "referrer",
|
|
"a25": "referrer_host",
|
|
"a26": "title",
|
|
"a27": "screen_name",
|
|
"a28": "element_id",
|
|
"a29": "element_type",
|
|
"a30": "resume_from_background",
|
|
"a31": "element_selector",
|
|
"a32": "element_position",
|
|
"a33": "element_content",
|
|
"a34": "scene",
|
|
"a35": "mp_platform",
|
|
"a36": "app_crashed_reason",
|
|
"a37": "zone_offset",
|
|
"b01": "app_id",
|
|
"b06": "event_time"
|
|
}
|
|
|
|
TA_MAP = {
|
|
"user_id": "#user_id",
|
|
"account_id": "#account_id",
|
|
"distinct_id": "#distinct_id",
|
|
"event_name": "#event_name",
|
|
"server_time": "#server_time",
|
|
"ip": "#ip",
|
|
"country": "#country",
|
|
"country_code": "#country_code",
|
|
"province": "#province",
|
|
"city": "#city",
|
|
"os_version": "#os_version",
|
|
"manufacturer": "#manufacturer",
|
|
"os": "#os",
|
|
"device_id": "#device_id",
|
|
"screen_height": "#screen_height",
|
|
"screen_width": "#screen_width",
|
|
"device_model": "#device_model",
|
|
"app_version": "#app_version",
|
|
"bundle_id": "#bundle_id",
|
|
"lib": "#lib",
|
|
"lib_version": "#lib_version",
|
|
"network_type": "#network_type",
|
|
"carrier": "#carrier",
|
|
"browser": "#browser",
|
|
"browser_version": "#browser_version",
|
|
"duration": "#duration",
|
|
"url": "#url",
|
|
"url_path": "#url_path",
|
|
"referrer": "#referrer",
|
|
"referrer_host": "#referrer_host",
|
|
"title": "#title",
|
|
"screen_name": "#screen_name",
|
|
"element_id": "#element_id",
|
|
"element_type": "#element_type",
|
|
"resume_from_background": "#resume_from_background",
|
|
"element_selector": "#element_selector",
|
|
"element_position": "#element_position",
|
|
"element_content": "#element_content",
|
|
"scene": "#scene",
|
|
"mp_platform": "#mp_platform",
|
|
"app_crashed_reason": "#app_crashed_reason",
|
|
"zone_offset": "#zone_offset",
|
|
"app_id": "#app_id",
|
|
"event_time": "#event_time"
|
|
}
|
|
|
|
TA_OUTER = {'#time', '#ip', '#type', '#distinct_id', '#account_id', 'event_name'}
|
|
|
|
REDIS_CONF = {
|
|
'address': ('192.168.0.161', 6379),
|
|
'password': 'd1Gh*zp5',
|
|
'db': 1
|
|
}
|
|
SALT = '0r4X00mH'
|
|
KAFKA_CONF = {
|
|
'bootstrap_servers': ["192.168.0.30:9092", "192.168.0.71:9092", "192.168.0.229:9092"],
|
|
'value_serializer': lambda v: json.dumps(v).encode('utf-8'),
|
|
}
|
|
|
|
|
|
class Debug(Config):
|
|
REDIS_CONF = {
|
|
'address': ('192.168.0.161', 6379),
|
|
'password': 'd1Gh*zp5',
|
|
'db': 0
|
|
}
|
|
|
|
|
|
settings = Debug
|