import platform

# 需要用到的表
DB_REQUESTS_ASIN_PARAMS = {
    "db_syn": "us_all_syn_st",
    "db_variat": "us_variat",  # 更改
    "db_cookies": "us_cookies",
    "db_us_erp_asin_syn": "us_erp_asin_syn",
    "db_us_erp_asin": "us_erp_asin",
    "db_seller_account_syn": "us_seller_account_syn",
    "db_seller_asin_account": "us_seller_asin_account",
    "db_asin_image": "us_asin_image",
    "db_seller_account_feedback_5000_asin_syn": "us_seller_account_feedback_5000_asin_syn",
    "db_amazon_seller_account": "amazon_seller_account",
    "db_ip_16yun": "ip_16yun",
    "db_request_param_val": "us_request_param_val",
    "db_seller_account_feedback": "us_seller_account_feedback",
    "db_self_asin_detail": "us_self_asin_detail",
    "db_seller_account_product_syn": "us_seller_account_product_syn",
    "db_seller_account_feedback_new": "us_seller_account_feedback_report",
    "db_competitive_aisn_syn": "us_competitive_aisn_syn",
    "db_competitive_aisn": "us_competitive_aisn",
    "db_asin_detail_product": "fr_seller_asin_product",
    "db_search_term": "us_search_term",
    "db_variation_total": "us_variation_total",
    "db_asin_star": "uk_asin_star",
    "db_asin_add_cart": "us_asin_fb_together",
    "db_brand_asin": "us_brand_asin",
    "db_bs_category_asin_detail": "fr_bs_category_asin_detail",
    "db_asin_of_concern": "us_asin_of_concern",
    "db_potential_product_asin_syn": "us_potential_product_asin_syn",
    "db_potential_product_asin": "us_potential_product_asin",
    'db_user_collection_syn': 'user_collection_syn',
    'db_self_product_detail': "us_self_product_detail",
    "int_threading_num": 9,
    "if_ip_num_proxy": 100,
    "if_ip_num": 20,
    "requests_timeout": 15,
    "de_requests_timeout": 15,
    "de_int_threading_num": 8,
    "feedback_threading_num": 8
}
DB_SEARCH_TERM_PARAMS_SPIDER = {
    "db_search_term": "us_search_term",
    "db_asin_detail_simply": "us_asin_detail_simply",
    "db_search_term_serverip": "us_search_term_serverip",
    "db_search_term_zr": "us_search_term_rank_zr",
    "db_search_term_sp": "us_search_term_rank_sp",
    "db_search_term_sb": "us_search_term_rank_sb",
    "db_search_term_ac": "us_search_term_rank_ac",
    "db_search_term_bs": "us_search_term_rank_bs",
    "db_search_term_er": "us_search_term_rank_er",
    "db_search_term_hr": "us_search_term_rank_hr",
    "db_search_term_tr": "us_search_term_rank_tr",
    "db_other_search_term": "us_other_search_term",
    "us_brand_analytics": "us_brand_analytics",

}
DB_SEARCH_TERM_PARAMS_SPIDER_MYSQL = {
    "db_search_term": "us_search_term",
    "db_asin_detail_simply": "us_asin_detail_simply",
    "db_search_term_serverip": "us_search_term_serverip",
    "db_search_term_zr": "us_search_term_rank_zr",
    "db_search_term_sp": "us_search_term_rank_sp",
    "db_search_term_sb": "us_search_term_rank_sb",
    "db_search_term_ac": "us_search_term_rank_ac",
    "db_search_term_bs": "us_search_term_rank_bs",
    "db_search_term_er": "us_search_term_rank_er",
    "db_search_term_hr": "us_search_term_rank_hr",
    "db_search_term_tr": "us_search_term_rank_tr",
    "db_potential_product_st_syn": "us_potential_product_st_syn",
    "db_potential_product_st": "us_potential_product_st",
    "db_other_search_term": "us_other_search_term",
    "us_brand_analytics": "us_brand_analytics",

}
# 连接mysql数据库参数
DB_CONN_DICT = {
    "mysql_port": 3306,
    "mysql_db": "selection",
    "mysql_user": "adv_yswg",
    "mysql_pwd": "Gd1pGJog1ysLMLBdML8w81",
    "mysql_host": "rm-wz9yg9bsb2zf01ea4yo.mysql.rds.aliyuncs.com",
}
# 连接pg14数据库参数 113.100.143.162:5432
if platform.system().lower() == 'windows':
    PG_CONN_DICT = {
        "pg_port": 5432,
        "pg_db": "selection",
        "pg_user": "postgres",
        "pg_pwd": "fazAqRRVV9vDmwDNRNb593ht5TxYVrfTyHJSJ3BS",
        "pg_host": "192.168.10.223",
    }
else:
    PG_CONN_DICT = {
        "pg_port": 54328,
        "pg_db": "selection",
        "pg_user": "postgres",
        "pg_pwd": "fazAqRRVV9vDmwDNRNb593ht5TxYVrfTyHJSJ3BS",
        "pg_host": "61.145.136.61",
    }

# 连接pg6数据库参数 113.100.143.162:5432
if platform.system().lower() == 'windows':
    PG_CONN_DICT_6 = {
        "pg_port": 5432,
        "pg_db": "selection",
        "pg_user": "postgres",
        "pg_pwd": "fazAqRRVV9vDmwDNRNb593ht5TxYVrfTyHJSJ3BS",
        "pg_host": "113.100.143.162",
    }
else:
    PG_CONN_DICT_6 = {
        "pg_port": 5432,
        "pg_db": "selection",
        "pg_user": "postgres",
        "pg_pwd": "fazAqRRVV9vDmwDNRNb593ht5TxYVrfTyHJSJ3BS",
        "pg_host": "113.100.143.162",
    }
# 连接pg12数据库参数 113.100.143.162:5443
if platform.system().lower() == 'windows':
    PG_CONN_DICT_21 = {
        "pg_port": 5443,
        "pg_db": "selection",
        "pg_user": "postgres",
        "pg_pwd": "fazAqRRVV9vDmwDNRNb593ht5TxYVrfTyHJSJ3BS",
        "pg_host": "113.100.143.162",
    }
else:
    PG_CONN_DICT_21 = {
        "pg_port": 5443,
        "pg_db": "selection",
        "pg_user": "postgres",
        "pg_pwd": "fazAqRRVV9vDmwDNRNb593ht5TxYVrfTyHJSJ3BS",
        "pg_host": "113.100.143.162",
    }
# doris
DORIS_CONN = {
    "doris_port": 19030,
    "doris_db": "selection",
    "doris_user": "root",
    "doris_host": "113.100.143.162",
    "doris_pwd": ""
}
# redis
REDIS_CONN = {
    "redis_host": "113.100.143.162",
    "redis_port": 6379,
    "redis_pwd": "yswg2023",
    "redis_db": 14

}
# 连接starrocks数据库参数
if platform.system().lower() == 'windows':
    starrocks_CONN = {
        "mysql_port": 19030,
        "mysql_db": "us_spider",
        "mysql_user": "pengyanbing",
        "mysql_pwd": "pengyanbing12345",
        "mysql_host": "113.100.143.162"
    }
else:
    starrocks_CONN = {
        "mysql_port": 19030,
        "mysql_db": "us_spider",
        "mysql_user": "pengyanbing",
        "mysql_pwd": "pengyanbing12345",
        "mysql_host": "192.168.10.151"
    }