Commit 98e4ffae authored by lixiaofang's avatar lixiaofang

add

parent 7ddf7912
......@@ -42,7 +42,7 @@ def get_discover_page_topic_ids(user_id,device_id,size,query_type=TopicPageType.
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return []
def get_home_recommend_topic_ids(user_id,device_id,offset,size,query=None,query_type=TopicPageType.HOME_RECOMMEND):
def get_home_recommend_topic_ids(tag_id,user_id,device_id,offset,size,query=None,query_type=TopicPageType.HOME_RECOMMEND):
try:
if query is None:
if user_id == -1:
......@@ -75,7 +75,7 @@ def get_home_recommend_topic_ids(user_id,device_id,offset,size,query=None,query_
redis_user_similar_score_redis_val = redis_client.get(user_similar_score_redis_key)
user_similar_score_redis_list = json.loads(redis_user_similar_score_redis_val) if redis_user_similar_score_redis_val else []
topic_id_dict = TopicUtils.get_recommend_topic_ids(user_id, offset, size*size,query,query_type,filter_topic_id_list=have_read_topic_id_list,recommend_tag_list=recommend_tag_list,user_similar_score_list=user_similar_score_redis_list)
topic_id_dict = TopicUtils.get_recommend_topic_ids(tag_id,user_id, offset, size*size,query,query_type,filter_topic_id_list=have_read_topic_id_list,recommend_tag_list=recommend_tag_list,user_similar_score_list=user_similar_score_redis_list)
have_read_group_id_set = set()
have_read_user_id_set = set()
unread_topic_id_dict = dict()
......@@ -187,7 +187,7 @@ def discover_page(device_id="",user_id=-1,size=10):
@bind("physical/search/home_query")
def home_query(device_id="",user_id=-1,query="",offset=0,size=10):
def home_query(tag_id="",device_id="",user_id=-1,query="",offset=0,size=10):
"""
:remark:首页搜索,目前只推荐日记
:param session_id:
......@@ -203,7 +203,7 @@ def home_query(device_id="",user_id=-1,query="",offset=0,size=10):
if not isinstance(device_id,str):
device_id = ""
recommend_topic_ids = get_home_recommend_topic_ids(user_id,device_id,offset,size,query)
recommend_topic_ids = get_home_recommend_topic_ids(tag_id,user_id,device_id,offset,size,query)
return {"recommend_topic_ids":recommend_topic_ids}
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment