Commit 6cc69075 authored by 段英荣's avatar 段英荣

modify

parent 603793b9
...@@ -43,6 +43,9 @@ def group_sort(user_id=-1,sort_type=GroupSortTypes.HOT_RECOMMEND,offset=0,size=1 ...@@ -43,6 +43,9 @@ def group_sort(user_id=-1,sort_type=GroupSortTypes.HOT_RECOMMEND,offset=0,size=1
:return: :return:
""" """
try: try:
if not isinstance(user_id,int):
user_id = -1
if sort_type==GroupSortTypes.HOT_RECOMMEND: if sort_type==GroupSortTypes.HOT_RECOMMEND:
group_ids_list = GroupUtils.get_hot_group_recommend_result_list(offset,size) group_ids_list = GroupUtils.get_hot_group_recommend_result_list(offset,size)
......
...@@ -13,6 +13,9 @@ from search.utils.common import PickType ...@@ -13,6 +13,9 @@ from search.utils.common import PickType
@bind("physical/search/pick_celebrity") @bind("physical/search/pick_celebrity")
def pick_celebrity(user_id,pick_id,offset=0,size=10): def pick_celebrity(user_id,pick_id,offset=0,size=10):
try: try:
if not isinstance(user_id,int):
user_id = -1
have_read_pick_celebrity_ids = list() have_read_pick_celebrity_ids = list()
redis_key = "physical:pick_celebrity:" + "user_id:" + str(user_id) + ":pick_id:" + str(pick_id) redis_key = "physical:pick_celebrity:" + "user_id:" + str(user_id) + ":pick_id:" + str(pick_id)
...@@ -42,6 +45,9 @@ def pick_celebrity(user_id,pick_id,offset=0,size=10): ...@@ -42,6 +45,9 @@ def pick_celebrity(user_id,pick_id,offset=0,size=10):
@bind("physical/search/pick_topic") @bind("physical/search/pick_topic")
def pick_topic(user_id,pick_id,offset=0,size=10): def pick_topic(user_id,pick_id,offset=0,size=10):
try: try:
if not isinstance(user_id,int):
user_id = -1
have_read_pick_topic_ids = list() have_read_pick_topic_ids = list()
redis_key = "physical:pick_topic:" + "user_id:" + str(user_id) + ":pick_id:" + str(pick_id) redis_key = "physical:pick_topic:" + "user_id:" + str(user_id) + ":pick_id:" + str(pick_id)
......
...@@ -144,6 +144,9 @@ def topic_detail_page_recommend(user_id=-1,topic_id=-1,topic_group_id=-1,topic_u ...@@ -144,6 +144,9 @@ def topic_detail_page_recommend(user_id=-1,topic_id=-1,topic_group_id=-1,topic_u
:return: :return:
""" """
try: try:
if not isinstance(user_id,int):
user_id = -1
# 获取帖子标签列表 # 获取帖子标签列表
topic_tag_list = TopicUtils.get_topic_tag_id_list(topic_id) topic_tag_list = TopicUtils.get_topic_tag_id_list(topic_id)
......
...@@ -23,6 +23,9 @@ def recommend_user(self_user_id,interesting_user_id,offset=0,size=10): ...@@ -23,6 +23,9 @@ def recommend_user(self_user_id,interesting_user_id,offset=0,size=10):
:return: :return:
""" """
try: try:
if not isinstance(self_user_id,int):
self_user_id = -1
#获取关注用户列表 #获取关注用户列表
(self_attention_user_id_list,recursion_attention_user_id_list) = UserUtils.get_attention_user_list([self_user_id,interesting_user_id],self_user_id) (self_attention_user_id_list,recursion_attention_user_id_list) = UserUtils.get_attention_user_list([self_user_id,interesting_user_id],self_user_id)
......
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