|
@@ -14,7 +14,7 @@ log_ = Log()
|
|
|
config_ = set_config()
|
|
|
|
|
|
|
|
|
-def video_recommend(mid, uid, size, app_type, algo_type):
|
|
|
+def video_recommend(mid, uid, size, app_type, algo_type, client_info):
|
|
|
"""
|
|
|
首页线上推荐逻辑
|
|
|
:param mid: mid type-string
|
|
@@ -22,6 +22,7 @@ def video_recommend(mid, uid, size, app_type, algo_type):
|
|
|
:param size: 请求视频数量 type-int
|
|
|
:param app_type: 产品标识 type-int
|
|
|
:param algo_type: 算法类型 type-string
|
|
|
+ :param client_info: 用户位置信息 {"country": "国家", "province": "省份", "city": "城市"}
|
|
|
:return:
|
|
|
"""
|
|
|
ab_code = config_.AB_CODE
|
|
@@ -44,7 +45,7 @@ def video_recommend(mid, uid, size, app_type, algo_type):
|
|
|
pool.join()
|
|
|
'''
|
|
|
recall_result_list = []
|
|
|
- pool_recall = PoolRecall(app_type=app_type, mid=mid, uid=uid, ab_code=ab_code)
|
|
|
+ pool_recall = PoolRecall(app_type=app_type, mid=mid, uid=uid, ab_code=ab_code, client_info=client_info)
|
|
|
_, last_rov_recall_key, _ = pool_recall.get_video_last_idx()
|
|
|
t = [gevent.spawn(pool_recall.rov_pool_recall, size), gevent.spawn(pool_recall.flow_pool_recall, size) ]
|
|
|
gevent.joinall(t)
|
|
@@ -138,10 +139,9 @@ def video_relevant_recommend(mid, uid, size, app_type):
|
|
|
:param uid: uid type-string
|
|
|
:param size: 请求视频数量 type-int
|
|
|
:param app_type: 产品标识 type-int
|
|
|
- :param algo_type: 算法类型 type-string
|
|
|
:return: videos type-list
|
|
|
"""
|
|
|
- videos = video_recommend(mid=mid, uid=uid, size=size, app_type=app_type, algo_type='')
|
|
|
+ videos = video_recommend(mid=mid, uid=uid, size=size, app_type=app_type, algo_type='', client_info=None)
|
|
|
return videos
|
|
|
|
|
|
|