#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Copyright (C) ansjer cop Video Technology Co.,Ltd.All rights reserved.
@AUTHOR: ASJRD018
@NAME: Ansjer
@software: PyCharm
@DATE: 2018/7/2 14:06
@Version: python3.6
@MODIFY DECORD:ansjer dev
@file: Conf.py
@Contact: chanjunkai@163.com
"""
# 主要静态变量配置文件
import datetime, os

SERVER_TYPE = os.environ.get('DJANGO_SETTINGS_MODULE')
print(SERVER_TYPE)

# 亚马逊的数据库DynamoDB的密钥
AWS_DynamoDB_REGION = 'us-west-1'
AWS_DynamoDB_ACCESS_KEY = 'AKIA2E67UIMD6X23FEBG'
AWS_DynamoDB_SECRET_KEY = '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'

# 阿里云发邮箱
ALY_SES_ACCESS_NAME = 'message@dvema.com'
ALY_SES_ACCESS_PAW = 'SMtp123456'
ALY_SES_ACCESS_REPLYTO = '***'

# 发送邮件邮箱
SES_COMPANY_EMAIL = 'user_server@nsst.com'
AWS_SES_ACCESS_ID = 'AKIAJKPU23EU5QWHFPKQ'
AWS_SES_ACCESS_SECRET = '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'
AWS_SES_ACCESS_REGION = 'us-east-1'
AWS_SES_ACCESS_REGION_WEST = 'us-west-1'

AWS_BUCKET = 'ansjertest'
# 设定离线时间为5分钟
OFF_LINE_TIME_DELTA = 5

# token的secret
OAUTH_ACCESS_TOKEN_SECRET = 'a+jbgnw%@1%zy^=@dn62%'
OAUTH_REFRESH_TOKEN_SECRET = 'r+jbgnw%@1%zy^=@dn62%'

# access_token超时
# OAUTH_ACCESS_TOKEN_TIME = datetime.timedelta(hours=1)
OAUTH_ACCESS_TOKEN_TIME = datetime.timedelta(days=30)
# refresh_token超时
OAUTH_REFRESH_TOKEN_TIME = datetime.timedelta(days=30)
# 腾讯验证,短信发送
TX_PHONE_APP_ID = '1400052907'
TX_PHONE_APP_KEY = '7705976ca6e85fe7b86d6bc2d11f7783'

# 验证码超时时间
AuthCode_Expire = 600

RTMP_PUSH_URL = 'http://13.56.215.252:8091/hls'
# 根路径
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ADDR_URL = []
# uid token key
UID_TOKEN_KEY = 'c+565*j@%^'

UNICODE_ASCII_CHARACTER_SET = ('abcdefghijklmnopqrstuvwxyz'
                               'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                               '0123456789')

# oss param
OSS_STS_ACCESS_KEY = 'LTAIyMkGfEdogyL9'
OSS_STS_ACCESS_SECRET = '71uIjpsqVOmF7DAITRyRuc259jHOjO'
OSS_ROLE_ARN = 'acs:ram::1901342792446414:role/stsoss'

# aws api key
AWS_ACCESS_KEY_ID = ['AKIA2MMWBR4DSFG67DTG','AKIA2E67UIMD45Y3HL53']  #0国内， 1国外
AWS_SECRET_ACCESS_KEY = ['aI9gxcAKPmiGgPy9axrtFKzjYGbvpuytEX4xWweL','ckYLg4Lo9ZXJIcJEAKkzf2rWvs8Xth1FCjqiAqUw']
AWS_ARN = ['arn:aws-cn:s3','arn:aws:s3']

#尚云服务器CRCKey
CRCKey = {'AUS':'CRCKey', 'ACN':'CRCKey'}   #{平台名：CRCKey值}

# 各个服务器域名
SERVER_DOMAIN_US = 'http://www.dvema.com/'
SERVER_DOMAIN_CN = 'http://www.zositechc.cn/'
SERVER_DOMAIN_EUR = 'http://www.zositeche.com/'
SERVER_DOMAIN_TEST = 'http://test.zositechc.cn/'

# 不同环境配置
# 本地
if SERVER_TYPE == 'Ansjer.local_config.local_settings':
    from Ansjer.local_config.config_local import *
# 美国
elif SERVER_TYPE == 'Ansjer.us_config.test_settings':
    from Ansjer.us_config.config_test import *
elif SERVER_TYPE == 'Ansjer.us_config.formal_settings':
    from Ansjer.us_config.config_formal import *

# 国内
elif SERVER_TYPE == 'Ansjer.cn_config.formal_settings':
    from Ansjer.cn_config.config_formal import *
elif SERVER_TYPE == 'Ansjer.cn_config.test_settings':
    from Ansjer.cn_config.config_test import *


DEVICE_TYPE = {
    0: 'UNKOWN',
    1: 'DVR',
    2: 'NVR',
    3: 'POENVR',
    4: 'WIRELESSNVR',
    5: 'POEIPC',
    6: 'BOLTIPC',
    7: 'IPC',
    8: 'KAPIANJI',
    9: 'FISHEYE',
    10: 'C512',
    11: 'C611',
    12: 'C612',
    13: 'C199',
    14: 'C190',
    15: 'C199_PRO',
    17: 'C289',
    18: 'C308',
    10001: 'DVRPTZ'
}

APP_FREQUENT = {
    0: 'UNKOWN',
    1: '每天',
    2: '三天',
    3: '一周',
    4: '两周',
    5: '一个月',
    6: '一个月以上',

}

# Iot Core国外
AWS_IOT_SES_ACCESS_FOREIGN_ID = 'AKIA2E67UIMD62VUBV5I'
AWS_IOT_SES_ACCESS_FOREIGN_SECRET = '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'
AWS_IOT_SES_ACCESS_FOREIGN_REGION_AMERICA = 'us-east-1'
AWS_IOT_SES_ACCESS_FOREIGN_REGION_ASIA = 'ap-southeast-1'
AWS_IOT_SES_ACCESS_FOREIGN_REGION_EUROPE = 'eu-west-1'
AWS_IOT_SES_ACCESS_FOREIGN_ROLE = 'arn:aws:iam::697864307463:role/Ansjer_Iot_Admin'

# Iot 获取上传S3日志 key国外
AWS_IOT_GETS3_PULL_FOREIGN_ID = 'AKIA2E67UIMDZSLTUD22'
AWS_IOT_GETS3_PULL_FOREIGN_SECRET = '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'

# Iot 获取上传S3日志 key国内
AWS_IOT_GETS3_PULL_CHINA_ID = 'AKIA2MMWBR4D3F4IEZE5'
AWS_IOT_GETS3_PULL_CHINA_SECRET = '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'

# Iot Core国内
AWS_IOT_SES_ACCESS_CHINA_ID = 'AKIA2MMWBR4DUUYPCFNJ'
AWS_IOT_SES_ACCESS_CHINA_SECRET = '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'
AWS_IOT_SES_ACCESS_CHINA_REGION = 'cn-northwest-1'
AWS_IOT_SES_ACCESS_CHINA_ROLE = 'arn:aws-cn:iam::713816116999:role/service-role/Ansjer_Iot_Admin'

IOT_HOST = {
    1: 'a250bbr0p9u7as-ats.iot.cn-northwest-1.amazonaws.com.cn',
    2: 'a2rqy12o004ad8-ats.iot.ap-southeast-1.amazonaws.com',
    3: 'a2rqy12o004ad8-ats.iot.eu-west-1.amazonaws.com',
    4: 'a2rqy12o004ad8-ats.iot.us-east-1.amazonaws.com'
}
ONLINE_DEVICE = 1000000

SALES = {
    2020: [
        {
            'name': 'United States',
            'value': [3768901, 23.337, '美国']
        },
        {
            'name': 'Japan',
            'value': [1886988, 9.027, '日本']
        },
        {
            'name': 'Russia',
            'value': [1940038, 7.923, '俄国']
        },
        {
            'name': 'Germany',
            'value': [1319651, 6.253, '德国']
        },
        {
            'name': 'France',
            'value': [1291157, 5.825, '法国']
        },
        {
            'name': 'United Kingdom',
            'value': [1041917, 4.567, '英国']
        },
        {
            'name': 'Italy',
            'value': [859811, 3.875, '意大利']
        }
    ],
    2019: [
        {
            'name': 'United States',
            'value': [2768900, 37.374, '美国']
        },
        {
            'name': 'Japan',
            'value': [1086988, 14.672, '日本']
        },
        {
            'name': 'Russia',
            'value': [940038, 12.689, '俄国']
        },
        {
            'name': 'Germany',
            'value': [919651, 12.413, '德国']
        },
        {
            'name': 'France',
            'value': [691157, 9.329, '法国']
        },
        {
            'name': 'United Kingdom',
            'value': [541917, 7.315, '英国']
        },
        {
            'name': 'Italy',
            'value': [459811, 6.206, '意大利']
        }
    ],
    2018: [
        {
            'name': 'United States',
            'value': [2068912, 32.329, '美国']
        },
        {
            'name': 'Japan',
            'value': [1007988, 15.751, '日本']
        },
        {
            'name': 'Germany',
            'value': [909653, 14.214, '德国']
        },
        {
            'name': 'Russia',
            'value': [900038, 14.064, '俄国']
        },

        {
            'name': 'France',
            'value': [601158, 9.394, '法国']
        },
        {
            'name': 'United Kingdom',
            'value': [501920, 7.843, '英国']
        },
        {
            'name': 'Italy',
            'value': [409813, 6.404, '意大利']
        }
    ],
    2017: [
        {
            'name': 'United States',
            'value': [1668900, 30.914, '美国']
        },
        {
            'name': 'Japan',
            'value': [906988, 16.800, '日本']
        },
        {
            'name': 'Germany',
            'value': [809651, 14.998, '德国']
        },
        {
            'name': 'Russia',
            'value': [800038, 14.820, '俄国']
        },
        {
            'name': 'France',
            'value': [501157, 9.283, '法国']
        },
        {
            'name': 'United Kingdom',
            'value': [401920, 7.445, '英国']
        },
        {
            'name': 'Italy',
            'value': [309822, 5.739, '意大利']
        }
    ],
    2016: [
        {
            'name': 'United States',
            'value': [1468900, 31.943, '美国']
        },
        {
            'name': 'Japan',
            'value': [806988, 17.549, '日本']
        },
        {
            'name': 'Germany',
            'value': [709651, 15.432, '德国']
        },
        {
            'name': 'Russia',
            'value': [700038, 15.223, '俄国']
        },

        {
            'name': 'France',
            'value': [401157, 8.724, '法国']
        },
        {
            'name': 'United Kingdom',
            'value': [301917, 6.566, '英国']
        },
        {
            'name': 'Italy',
            'value': [209811, 4.562, '意大利']
        }
    ]

}

# type =2
JPUSH_CONFIG = {
    'com.ansjer.accloud_ab': {
        'Key': 'f0dc047e5e53fd14199de5b0',
        'Secret': 'aa7f7db33e9f0a7f3871aa1c'},
    'com.ansjer.adcloud_ab': {
        'Key': '76d97b535185114985608234',
        'Secret': 'c9a92b301043cc9c52778692'},
    'com.ansjer.zccloud_ab': {
        'Key': 'd9924f56d3cc7c6017965130',
        'Secret': '869d832d126a232f158b5987'},
    'com.ansjer.loocamccloud_ab': {
        'Key': 'd1cc44797b4642b0e05304fe',
        'Secret': 'c3e8b4ca8c576de61401e56a'},
    'com.ansjer.loocamdcloud_ab': {
        'Key': '76d97b535185114985608234',
        'Secret': 'c9a92b301043cc9c52778692'},
    'com.ansjer.zccloud_a': {
        'Key': '57de2a80d68bf270fd6bdf5a',
        'Secret': '3d354eb6a0b49c2610decf42'},
    'com.ansjer.accloud_a': {
        'Key': 'ff95ee685f49c0dc4013347b',
        'Secret': 'de2c20959f5516fdeeafe78e'},
    'com.ansjer.adcloud_a': {
        'Key': '2e47eb1aee9b164460df3668',
        'Secret': 'b9137d8d684bc248f1809b6d'},
    'com.ansjer.loocamccloud_a': {
        'Key': '23c9213215c7ca0ec945629b',
        'Secret': '81e4b1e859cc8387e2e6c431'},
    'com.ansjer.loocamdcloud_a': {
        'Key': '1dbdd60a16e9892d6f68a073',
        'Secret': '80a97690e7e043109059b403'},
    'com.ansjer.customizedb_a': {
        'Key': '9d79630aa49adfa291fe2568',
        'Secret': '4d8ff52f88136561875a0212'},
    'com.ansjer.customizedd_a': {
        'Key': '8fc4f495685bde53341ee25d',
        'Secret': 'f1da11fa466509fa2670fb66'},
    'com.ansjer.customizeda_a': {
        'Key': 'aad8a02b1c4e82b0ef49c559',
        'Secret': '8798cc7cd63225f13660421a'},
    'com.ansjer.customizedc_a': {
        'Key': 'ecdde95cd272f410ee029139',
        'Secret': '9ddca1e92bfa331126fd8826'},
}
# type =1
FCM_CONFIG = {
    'com.ansjer.zccloud_a': 'AAAAb9YP3rk:APA91bHu8u-CTpcd0g6lKPo0WNVqCi8jZub1cPPbSAY9AucT1HxlF65ZDUko9iG8q2ch17bwu9YWHpK1xI1gHSRXCslLvZlXEmHZC0AG3JKg15XuUvlFKACIajUFV-pOeGRT8tM6-31I',
    'com.ansjer.loocamccloud_a': 'AAAAb9YP3rk:APA91bFCgd-kbVmpK4EVpfdHH_PJZQCYTkOGnTZdIuBWEz2r7aMRsJYHOH3sB-rwcbaRWgnufTyjX9nGQxb6KxQbWVk4ah_H-M3IqGh6Mb60WQQAuR33V6g_Jes5pGL6ViuIxGHqVMaR',
    'com.ansjer.loocamdcloud_a': 'AAAAb9YP3rk:APA91bGw2I2KMD4i-5T7nZO_wB8kuAOuqgyqe5rxmY-W5qkpYEx9IL2IfmC_qf6B_xOyjIDDSjckvMo-RauN__SEoxvAkis7042GRkoKpw7cjZ_H8lC-d50PC0GclPzccrOGFusyKbFY',
    'com.ansjer.customizedb_a': 'AAAAb9YP3rk:APA91bE7kI4vcm-9h_CJNFlOZfc-xwP4Btn6AnjOrwoKV6fgYN7fdarkO76sYxVZiAbDnxsFfOJyP7vQfwyan6mdjuyD5iHdt_XgO22VqniC0vA1V4GJiCS8Tp7LxIX8JVKZl9I_Powt',
    'com.ansjer.customizeda_a': 'AAAAb9YP3rk:APA91bF0HzizVWDc6dKzobY9fsaKDK4veqkOZehDXshVXs8pEEvNWjR_YWbhP60wsRYCHCal8fWN5cECVOWNMMzDsfU88Ty2AUl8S5FtZsmeDTkoGntQOswBr8Ln7Fm_LAp1VqTf9CpM',
    'com.ansjer.customizedd_a': 'AAAAb9YP3rk:APA91bHkxOozJWBrlv3eNT0PgwosYENI9aM4Zuzd418cX-iKkpa1zFNC5MkNDKApx1KH4fhmAfaJ6IMRZ0nj5GIxCpstDYCaZWwgC7-etqfSxG5JAq8LOwJx0o_1tUZqwjIic8ztsg0o',
    'com.ansjer.adcloud_a': 'AAAAb9YP3rk:APA91bFm06w8b9OKQ0gz0iaWFuRqRIkvgAz6z7Gp3dBU_X-LNGJQd1hc1QR2W7QzBglF8SHtERA45a2lbdLRa5qv7hxfd6W_sJLBK7dA8jklsOQBvy505oUzTwMKWy4TwH-exps9KrhO',
    'com.ansjer.accloud_a': 'AAAAb9YP3rk:APA91bFm06w8b9OKQ0gz0iaWFuRqRIkvgAz6z7Gp3dBU_X-LNGJQd1hc1QR2W7QzBglF8SHtERA45a2lbdLRa5qv7hxfd6W_sJLBK7dA8jklsOQBvy505oUzTwMKWy4TwH-exps9KrhO',
    'com.ansjer.zccloud_ab': 'AAAAb9YP3rk:APA91bHu8u-CTpcd0g6lKPo0WNVqCi8jZub1cPPbSAY9AucT1HxlF65ZDUko9iG8q2ch17bwu9YWHpK1xI1gHSRXCslLvZlXEmHZC0AG3JKg15XuUvlFKACIajUFV-pOeGRT8tM6-31I',
    'com.ansjer.customizedc_a': 'AAAAb9YP3rk:APA91bHu8u-CTpcd0g6lKPo0WNVqCi8jZub1cPPbSAY9AucT1HxlF65ZDUko9iG8q2ch17bwu9YWHpK1xI1gHSRXCslLvZlXEmHZC0AG3JKg15XuUvlFKACIajUFV-pOeGRT8tM6-31I',
}
APNS_CONFIG = {
    'com.ansjer.loocamccloud': {
        'pem_path': 'AnsjerPush/file/apns_pem/lcc-dev.pem',
    },
    'com.ansjer.zosidcloud': {
        'pem_path': 'AnsjerPush/file/apns_pem/zosidcloud-dev.pem',
    },
    'com.ansjer.customizedb': {
        'pem_path': 'AnsjerPush/file/apns_pem/customizedb-dev.pem',
    },
    'com.ansjer.customizeda': {
        'pem_path': 'AnsjerPush/file/apns_pem/customizeda-dev.pem',
    },
    'com.ansjer.zccloud': {
        'pem_path': 'Ansjer/file/apns_pem/zccloud-dev.pem',
    },
    'com.ansjer.accloud': {
        'pem_path': 'AnsjerPush/file/apns_pem/accloud-dev.pem',
    },
    'com.ansjer.customizedc':{
        'pem_path': 'AnsjerPush/file/apns_pem/customizedc.pem',
    },
    'com.ansjer.customizede': {
        'pem_path': 'AnsjerPush/file/apns_pem/customizede.pem',
    },
}
APNS_MODE = 'dev'
SERVER_TYPE = os.environ.get('DJANGO_SETTINGS_MODULE')

JPUSH_CODE = {
    -1: '只库存不推送',
    200: '推送成功',
    400: '错误请求',
    401: '没有验证信息或者验证失败',
    403: '请求被拒绝',
    404: '资源不存在，请求的用户的不存在，请求的格式不被支持',
    405: '请求方法不合适',
    410: '请求的资源已下线',
    429: '请求超出了频率限制',
    500: '极光内部服务错误',
    502: '业务服务器下线了或者正在升级。请稍后重试',
    503: '服务暂时失效',
    504: '代理超时'
}
APNS_CODE = {
    -1: '只库存不推送',
    200: '推送成功',
    400: '请求有问题',
    403: '证书或Token有问题',
    405: '请求方式不正确, 只支持POST请求',
    410: '设备的Token与证书不一致'
}
APP_TYPE = {
    1: 'ios',
    2: 'android'
}