# -*- coding: utf-8 -*-
import json
import requests
# url="http://127.0.0.1:4050/v1/once"
url="http://doris.paas-test.env/v1/once"

# 如果在生产环境doris 01上执行，把url改成"http://127.0.0.1:4050/v1/once"
header_dict={'Content-Type': 'application/x-www-form-urlencoded'}
param_dict={}

param_dict["method"]="doris/recommend/detail_service"
# 日记详情页召回美购
param_detail = {"card_id":9362282, "card_type":"diary","size":10,"user_city_tag_id":328,
                "device_id":"mike","read_service_ids":[]}

# 帖子详情页召回美购
# param_detail = {"card_id":20895840, "card_type":"usertopic","size":10,"user_city_tag_id":328,
#                 "device_id":"hello","read_service_ids":[]}
# 可视化召回
# param_detail = {"device_id":"3ab", "size":10,"offset":0,"user_city_tag_id":328,"recall_type":2,"unit_id":4,
#                 "sort_params":{"lat":0,"lng":0},"tag_ids":[],"filters":{},
#                 "new_tag_ids":[29]}

param_dict["params"]=json.dumps(param_detail)

a = requests.post(url=url,data=param_dict,headers=header_dict)

print(a.content)
