|
@@ -5,9 +5,10 @@ config_ = set_config()
|
|
|
redis_helper = RedisHelper()
|
|
|
|
|
|
|
|
|
-def ad_recommend_predict(mid, video_id):
|
|
|
+def ad_recommend_predict(app_type, mid, video_id):
|
|
|
"""
|
|
|
广告推荐预测
|
|
|
+ :param app_type: app_type
|
|
|
:param mid: mid
|
|
|
:param video_id: video_id
|
|
|
:return: ad_predict, type-int, 1-不发放广告,2-发放广告
|
|
@@ -49,7 +50,7 @@ def ad_recommend_predict(mid, video_id):
|
|
|
mid_video_share_rate = float(group_share_rate) * float(video_share_rate)
|
|
|
|
|
|
# 获取对应的阈值
|
|
|
- threshold_key_name = f"{config_.KEY_NAME_PREFIX_AD_THRESHOLD}{mid_group}"
|
|
|
+ threshold_key_name = f"{config_.KEY_NAME_PREFIX_AD_THRESHOLD}{app_type}:{mid_group}"
|
|
|
threshold = redis_helper.get_data_from_redis(key_name=threshold_key_name)
|
|
|
if threshold is None:
|
|
|
threshold = 0
|