# -*- 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/ai_similar_service"
param_detail = {"device_id":"xx","user_city_tag_id":350,"new_tag_ids":[[1068,2288],[912,385],[283,2599]]}

# param_dict["method"]="doris/search/doctor_officer"
# param_detail = {"device_id": '1',"size": 10,"offset":0, "query": "双眼皮","user_city_tag_id": 328,
#                 "is_officer":True,"filters":{},"sort_type":3}

# param_dict["method"]="doris/recommend/doctor_service"
# param_detail = {"id":"fengxiaobing","offset":0,"size":2,"is_doctor":False,"device_id":"aaa"}

# param_dict["method"]="doris/search/tag_count"
# param_detail = {"device_id":"3ab",
#                 "doctor_list":["e30b5c076770446b84580162b7d4df48","e35e6dbdabc740e69e2808e33505feaf"],
#                 "query":"吸脂"}

# param_dict["method"]="doris/recommend/homepage_polymer"
# param_detail = {"device_id":"3ab","size":10}


# param_dict["method"]="doris/search/top_doctor"
# #cpt
#
# param_detail = {"device_id":"865007","size":10,"user_city_tag_id":328,"offset":0,"is_officer":True,
#                 "business_recomment":True,"filters":{}}
# param_detail = {"is_merchant_cpt":True,"is_operation_cpt":True,"device_id":"baby",
#                 "size":6,"offset":0,"query":"切开双眼皮","user_city_tag_id":328,"city_id":"beijing",
#                 "sort_type":0,"sort_with_submission":False,"is_feed":False,'filters': {'area_tag_id': 328}
#                 }


# param_dict["method"]="doris/search/query_sku"
# param_detail = {"sort_with_submission": False,  "user_city_tag_id": 328, "sort_type": 0,
#                 "filters": {}, "offset": 0, "query": "切开双眼皮","size": 17}
# 第一次请求

# param_detail = {"is_merchant_cpt":True,"is_operation_cpt":True,"device_id":"baby",
#                 "size":10,"offset":0,"query":"切开双眼皮","user_city_tag_id":328,"city_id":"beijing",
#                 "sort_type":0,"sort_with_submission":False,"is_feed":True,'filters': {'area_tag_id': 328}
#                 }

# # # 第二次请求
#
# param_detail = {"is_merchant_cpt":True,"is_operation_cpt":True,"device_id":"baby",
#                 "size":10,"offset":0,"query":"切开双眼皮","user_city_tag_id":328,"city_id":"beijing",
#                 "sort_type":0,"sort_with_submission":False,"is_feed":False,'filters': {'area_tag_id': 328}
#                 }

# param_dict["method"]="doris/recommend/spu_detail_diary"
# param_detail = {"device_id":"3ab", "size":10,"offset":0,"service_id":5740173,"has_cover":True}


# "query":"双眼皮"
# tail -f filelog.log.20200701 | grep 3ab | grep doris/recommend/spu_detail_diary
param_dict["params"]=json.dumps(param_detail)

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

print(a.content)
