# -*- 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/search/spu_sku"
# param_detail = {'unit_id': 1, 'device_id': "863791030182646", 'offset': 0, 'size': 10,
#                 'user_city_tag_id': 328, 'recall_type': 2,
#                 'sort_params': {'lat': 40.000561, 'lng': 116.487496},
#                 'sort_type': 0, 'filters': {'tag_ids': []}, 'tag_ids': [], 'promotion_ids': []}

param_detail = {'unit_id': 4, 'device_id': "863791030182646", 'offset': 0, 'size': 10,
                'user_city_tag_id': 328, 'recall_type': 2,
                'sort_params': {'lat': 40.000561, 'lng': 116.487496},
                'sort_type': 0, 'filters': {'tag_ids': []}, 'tag_ids': [], 'promotion_ids': []}

# {"device_id":"3ab", "size":10,"offset":0,"user_city_tag_id":328,"recall_type":2,"unit_id":4,"sort_params":{"lat":0,"lng":0}}
# 美购首页活动美购
# param_dict["method"]="doris/search/activity"
# param_detail = {"device_id":"hello","promotion_id":342,"user_city_tag_id":328,"size":10}

# param_dict["method"]="doris/search/doctor_officer"
# param_detail = {"device_id":"hello","size":10,"user_city_tag_id":328,"offset":0,"is_officer":False,
#                 "filters":{},"query":"连喜艳"}


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

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

print(a.content)
