Commit 5252683a authored by 赵威's avatar 赵威

update logic

parent 4ab88b72
......@@ -146,9 +146,19 @@ def choice_pictorial_push_tag(device_id, user_id):
@bind("physical/search/lintag_by_user_id")
def get_lintags_by_user_id(user_id):
res = AccountRegExtra.objects.filter(user_id=user_id, is_online=True, is_deleted=False).values_list("device_id", flat=True)
print(res)
return {"abc": res}
try:
devices = AccountRegExtra.objects.filter(user_id=user_id, is_online=True, is_deleted=False).values_list("device_id", flat=True)
if devices:
linucb_recommend_redis_prefix = "physical:linucb:tag_recommend:device_id:"
device_id = devices[0]
tag_recommend_redis_key = linucb_recommend_redis_prefix + str(device_id)
linucb_recommend_tag_data = redis_client.get(tag_recommend_redis_key)
linucb_recommend_tag_list = json.loads(linucb_recommend_tag_data[:3]) if linucb_recommend_tag_data else []
return {"lin_tag_list": linucb_recommend_tag_list}
return {"lin_tag_list": []}
except Exception as e:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return {"lin_tag_list": []}
@bind("physical/search/choice_push_tag")
......
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