|
@@ -0,0 +1,280 @@
|
|
|
+import os
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class BaseConfig(object):
|
|
|
+
|
|
|
+ APP_TYPE = {
|
|
|
+ 'VLOG': 0,
|
|
|
+ 'LOVE_LIVE': 4,
|
|
|
+ 'LONG_VIDEO': 5,
|
|
|
+ 'SHORT_VIDEO': 6,
|
|
|
+ 'WAN_NENG_VIDEO': 17,
|
|
|
+ 'LAO_HAO_KAN_VIDEO': 18,
|
|
|
+ 'ZUI_JING_QI': 19,
|
|
|
+ 'APP': 13,
|
|
|
+ 'PIAO_QUAN_VIDEO_PLUS': 21,
|
|
|
+ 'JOURNEY': 22,
|
|
|
+ 'BLESSING_YEAR': 3,
|
|
|
+ }
|
|
|
+
|
|
|
+ ODPS_CONFIG = {
|
|
|
+ 'ENDPOINT': 'http://service.cn.maxcompute.aliyun.com/api',
|
|
|
+ 'ACCESSID': 'LTAIWYUujJAm7CbH',
|
|
|
+ 'ACCESSKEY': 'RfSjdiWwED1sGFlsjXv0DlfTnZTG1P',
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ALIYUN_LOG = {
|
|
|
+ 'ENDPOINT': 'cn-hangzhou-intranet.log.aliyuncs.com',
|
|
|
+ 'ACCESSID': 'LTAIWYUujJAm7CbH',
|
|
|
+ 'ACCESSKEY': 'RfSjdiWwED1sGFlsjXv0DlfTnZTG1P',
|
|
|
+ 'PROJECT': 'rov-server',
|
|
|
+ }
|
|
|
+
|
|
|
+ REDIS_INFO = {
|
|
|
+ 'host': 'r-bp1fogs2mflr1ybfot.redis.rds.aliyuncs.com',
|
|
|
+ 'port': 6379,
|
|
|
+ 'password': 'Wqsd@2019',
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ XNG_KEY_NAME = 'xng:videos'
|
|
|
+
|
|
|
+ SPECIAL_AREA_LIMIT_KEY_NAME = 'special:area:limit:videos'
|
|
|
+
|
|
|
+ PROJECT_REGION_APP_TYPE = 'loghubods'
|
|
|
+ TABLE_REGION_APP_TYPE = 'video_each_hour_update_province_apptype'
|
|
|
+
|
|
|
+ CITY_CODE = {
|
|
|
+ '广州': '440100', '深圳': '440300', '成都': '510100', '长沙': '430100',
|
|
|
+ }
|
|
|
+ DATA_PARAMS = {
|
|
|
+ 'data1': {APP_TYPE['VLOG']: 0},
|
|
|
+ 'data2': {APP_TYPE['VLOG']: 0.5, APP_TYPE['LONG_VIDEO']: 0.5},
|
|
|
+ 'data3': {APP_TYPE['VLOG']: 0.5, APP_TYPE['LOVE_LIVE']: 0.5},
|
|
|
+ 'data4': {APP_TYPE['VLOG']: 0.5, APP_TYPE['SHORT_VIDEO']: 0.5},
|
|
|
+
|
|
|
+ 'data6': {APP_TYPE['VLOG']: 0.25, APP_TYPE['LOVE_LIVE']: 0.25, APP_TYPE['SHORT_VIDEO']: 0.25,
|
|
|
+ APP_TYPE['LONG_VIDEO']: 0.25},
|
|
|
+ 'data7': {APP_TYPE['VLOG']: 0.5, APP_TYPE['APP']: 0.5},
|
|
|
+ 'data8': {APP_TYPE['VLOG']: 0.7, APP_TYPE['LONG_VIDEO']: 0.3},
|
|
|
+ 'data9': {APP_TYPE['VLOG']: 0.3, APP_TYPE['LONG_VIDEO']: 0.7},
|
|
|
+ 'data10': {APP_TYPE['VLOG']: 0.2, APP_TYPE['LOVE_LIVE']: 0.8},
|
|
|
+ 'data11': {APP_TYPE['VLOG']: 0.3, APP_TYPE['LOVE_LIVE']: 0.7},
|
|
|
+ 'data12': {APP_TYPE['VLOG']: 0.4, APP_TYPE['SHORT_VIDEO']: 0.6},
|
|
|
+ 'data13': {APP_TYPE['VLOG']: 0.3, APP_TYPE['SHORT_VIDEO']: 0.7},
|
|
|
+ 'data14': {APP_TYPE['VLOG']: 0.78, APP_TYPE['LOVE_LIVE']: 0.11, APP_TYPE['SHORT_VIDEO']: 0.08,
|
|
|
+ APP_TYPE['LONG_VIDEO']: 0.03},
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ REGION_CODE = {
|
|
|
+ '北京': '110000', '天津': '120000', '河北省': '130000', '山西省': '140000', '内蒙古': '150000',
|
|
|
+ '辽宁省': '210000', '吉林省': '220000', '黑龙江省': '230000',
|
|
|
+ '上海': '310000', '江苏省': '320000', '浙江省': '330000', '安徽省': '340000', '福建省': '350000', '江西省': '360000', '山东省': '370000',
|
|
|
+ '河南省': '410000', '湖北省': '420000', '湖南省': '430000', '广东省': '440000', '广西': '450000', '海南省': '460000',
|
|
|
+ '重庆': '500000', '四川省': '510000', '贵州省': '520000', '云南省': '530000', '西藏': '540000',
|
|
|
+ '陕西省': '610000', '甘肃省': '620000', '青海省': '630000', '宁夏': '640000', '新疆': '650000',
|
|
|
+ '台湾省': '710000', '香港': '810000', '澳门': '820000',
|
|
|
+ 'None': '-1'
|
|
|
+ }
|
|
|
+
|
|
|
+ SHIELD_CONFIG2 = {
|
|
|
+ REGION_CODE['北京']: [XNG_KEY_NAME, SPECIAL_AREA_LIMIT_KEY_NAME, ],
|
|
|
+ REGION_CODE['None']: [SPECIAL_AREA_LIMIT_KEY_NAME, XNG_KEY_NAME, ],
|
|
|
+ CITY_CODE['广州']: [SPECIAL_AREA_LIMIT_KEY_NAME, ],
|
|
|
+ CITY_CODE['深圳']: [SPECIAL_AREA_LIMIT_KEY_NAME, ],
|
|
|
+ CITY_CODE['成都']: [SPECIAL_AREA_LIMIT_KEY_NAME, ],
|
|
|
+ CITY_CODE['长沙']: [SPECIAL_AREA_LIMIT_KEY_NAME, ],
|
|
|
+ }
|
|
|
+
|
|
|
+ RULE_PARAMS_REGION_APP_TYPE_48H = {
|
|
|
+ 'rule_params': {
|
|
|
+ 'rule5': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule2', '48h_rule_key': 'rule1'},
|
|
|
+ },
|
|
|
+ 'data_params': {
|
|
|
+ 'data1': [APP_TYPE['VLOG'], ],
|
|
|
+ },
|
|
|
+ 'params_list': [
|
|
|
+ {'data': 'data1', 'rule': 'rule5'},
|
|
|
+ ],
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ RULE_PARAMS_REGION_APP_TYPE = {
|
|
|
+ 'rule_params': {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 'rule4': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule2', '24h_rule_key': 'rule3'},
|
|
|
+
|
|
|
+ 'rule4-1': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule2', '24h_rule_key': 'rule3', 'political_filter': True},
|
|
|
+
|
|
|
+ 'rule4-2': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule2', '24h_rule_key': 'rule3', 'shield_config': SHIELD_CONFIG2},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 'rule7': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule4', '24h_rule_key': 'rule4', 'merge_func': 2},
|
|
|
+ 'rule7-1': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule4', '24h_rule_key': 'rule4', 'merge_func': 2,
|
|
|
+ 'political_filter': True},
|
|
|
+ 'rule8': {'view_type': 'preview', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule5', '24h_rule_key': 'rule4', 'merge_func': 2},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 'rule15': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule2', '24h_rule_key': 'rule3',
|
|
|
+ 'add_videos_with_pre_h': True, 'hour_count': 6},
|
|
|
+
|
|
|
+ 'rule16': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule2', '24h_rule_key': 'rule3',
|
|
|
+ 'add_videos_with_pre_h': True, 'hour_count': 2, 'add_func': 'func2'},
|
|
|
+
|
|
|
+ 'rule17': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule2', '24h_rule_key': 'rule3',
|
|
|
+ 'add_videos_with_pre_h': True, 'hour_count': 47},
|
|
|
+
|
|
|
+ 'rule18': {'view_type': 'video-show-region', 'platform_return_rate': 0.001,
|
|
|
+ 'region_24h_rule_key': 'rule2', '24h_rule_key': 'rule3',
|
|
|
+ 'add_videos_with_pre_h': True, 'hour_count': 3, 'add_func': 'func2'},
|
|
|
+
|
|
|
+ },
|
|
|
+ 'data_params': DATA_PARAMS,
|
|
|
+ 'params_list': [
|
|
|
+ {'data': 'data1', 'rule': 'rule4'},
|
|
|
+ {'data': 'data1', 'rule': 'rule4-1'},
|
|
|
+ {'data': 'data1', 'rule': 'rule4-2'},
|
|
|
+
|
|
|
+ {'data': 'data2', 'rule': 'rule7-1'},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {'data': 'data7', 'rule': 'rule8'},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {'data': 'data10', 'rule': 'rule7'},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ],
|
|
|
+ }
|
|
|
+
|
|
|
+class TestConfig(BaseConfig):
|
|
|
+ """测试环境配置"""
|
|
|
+
|
|
|
+ ENV_TEXT = "测试环境"
|
|
|
+
|
|
|
+ PROJECT_PATH = '/data2/rov-offline'
|
|
|
+
|
|
|
+
|
|
|
+ REDIS_INFO = {
|
|
|
+ 'host': 'r-bp1ps6my7lzg8rdhwx682.redis.rds.aliyuncs.com',
|
|
|
+ 'port': 6379,
|
|
|
+ 'password': 'Wqsd@2019',
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ HOLOGRES_INFO = {
|
|
|
+ 'host': 'hgprecn-cn-7pp28y18c00c-cn-hangzhou-vpc.hologres.aliyuncs.com',
|
|
|
+ 'port': 80,
|
|
|
+ 'dbname': 'dssm',
|
|
|
+ 'user': 'LTAI5tMPqPy9yboQAf1mBCCN',
|
|
|
+ 'password': '4BEcOgxREOPq7t3A7EWkjciVULeQGj'
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ MYSQL_INFO = {
|
|
|
+ 'host': 'rm-bp1k5853td1r25g3n690.mysql.rds.aliyuncs.com',
|
|
|
+ 'port': 3306,
|
|
|
+ 'user': 'wx2016_longvideo',
|
|
|
+ 'password': 'wx2016_longvideoP@assword1234',
|
|
|
+ 'db': 'longvideo',
|
|
|
+ 'charset': 'utf8'
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ FILTER_MYSQL_INFO = {
|
|
|
+ 'host': 'am-bp1g3ys9u00u483uc131930.ads.aliyuncs.com',
|
|
|
+ 'port': 3306,
|
|
|
+ 'user': 'lv_manager',
|
|
|
+ 'password': 'lv_manager@2020',
|
|
|
+ 'db': 'longvideo',
|
|
|
+ 'charset': 'utf8'
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ALIYUN_LOG = {
|
|
|
+ 'ENDPOINT': 'cn-hangzhou.log.aliyuncs.com',
|
|
|
+ 'ACCESSID': 'LTAIWYUujJAm7CbH',
|
|
|
+ 'ACCESSKEY': 'RfSjdiWwED1sGFlsjXv0DlfTnZTG1P',
|
|
|
+ 'PROJECT': 'rov-server-test',
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ VIDEO_STATUS = 'longvideo_test.dwd_mdm_item_video_stat'
|
|
|
+
|
|
|
+
|
|
|
+ QUICK_FLOW_POOL_ID = 3
|
|
|
+
|
|
|
+
|
|
|
+ GET_FLOW_POOL_RECOMMEND_CONFIG_URL = 'http://videotest-internal.yishihui.com/longvideoapi/openapi/recommend/getConfig'
|
|
|
+
|
|
|
+ GET_VIDEOS_FROM_POOL_URL = 'http://testapi-internal.piaoquantv.com/flowpool/video/getAllVideo'
|
|
|
+
|
|
|
+ GET_REMAIN_VIEW_COUNT_URL = 'http://testapi-internal.piaoquantv.com/flowpool/video/remainViewCount'
|
|
|
+
|
|
|
+ NOTIFY_BACKEND_UPDATE_ROV_SCORE_URL = 'http://videotest-internal.yishihui.com/longvideoapi/openapi/recommend/updateRovScore'
|
|
|
+
|
|
|
+ TOP_VIDEO_LIST_URL = 'http://videotest-internal.yishihui.com/longvideoapi/openapi/recommend/topVideoList'
|
|
|
+
|
|
|
+ BOTTOM_JSON_URL = 'http://videotest-internal.yishihui.com/longvideoapi/openapi/video/distribute/structure/video/list'
|
|
|
+
|
|
|
+ NOTIFY_BACKEND_updateFallBackVideoList_URL = 'http://videotest-internal.yishihui.com/longvideoapi/openapi/recommend/updateFallBackVideoList'
|
|
|
+
|
|
|
+ GET_VIDEO_LIMIT_LIST_URL = 'http://videotest-internal.yishihui.com/longvideoapi/openapi/recommend/getVideoLimitList'
|
|
|
+
|
|
|
+ GET_AD_TARGET_UV_URL = 'https://testadmin.piaoquantv.com/manager/ad/algo/threshold/productUvTargetList'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+def set_config():
|
|
|
+
|
|
|
+ env = os.environ.get('Base_ENV')
|
|
|
+ return TestConfig()
|
|
|
+
|
|
|
+
|