Commit a127c13a authored by 张彦钊's avatar 张彦钊

add

parent 59f7ecf2
......@@ -8,28 +8,18 @@ url="http://doris.paas-test.env/v1/once"
header_dict={'Content-Type': 'application/x-www-form-urlencoded'}
param_dict={}
param_dict["method"]="doris/search/spu_sku"
param_detail = {"device_id":"3ab", "size":10,"offset":0,"user_city_tag_id":328,"recall_type":1,"unit_id":2102,"promotion_ids":[],"sort_params":{"lat":0,"lng":0}}
# 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":[993, 971, 5, 41, 759, 47, 821]}
# 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': "xxr", 'offset': 0, 'size': 10,
# 'user_city_tag_id': 328, 'recall_type': 3,
# '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["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)
......
......@@ -10,5 +10,8 @@ T1 = [85,86,87,5057,88,89,101,102,777,780,95,890,2923,844,258,912,914,1324,2108,
152,197,776,804,868,885,954,5074,117,237,842,5077,778,782,783,784,785,788,789,2946,3043,2059,4437,98,114,120,125,135,136,140,153,793,805,886,1890,15,17,19,975,72,34,35,41,47,1387,1992,2942,2663,154,155,157,852,61,79,1055,2033,3042,3044,6147,2112]
r = redis.StrictRedis.from_url('redis://:ReDis!GmTx*0aN6@172.16.40.133:6379')
r.set(tag_key,json.dumps(T1))
# r = redis.StrictRedis.from_url('redis://:ReDis!GmTx*0aN6@172.16.40.133:6379')
r = redis.StrictRedis.from_url("redis://redis.paas-test.env:6379/0")
# r.set(tag_key,json.dumps(T1))
a = eval(r.get(tag_key))
print(a)
import pymysql
import pandas as pd
def get_city():
sql = "select c.name,d.name as near_city_name from (select a.city_id,a.nearby_city_id,b.name " \
"from api_transaction_nearby_city_to_es a left join api_city b on a.city_id = b.id) c " \
"left join api_city d on c.nearby_city_id = d.id"
db = pymysql.connect(host='172.16.30.141', port=3306, user='work', passwd='BJQaT9VzDcuPBqkd', db='zhengxing')
cursor = db.cursor()
cursor.execute(sql)
result = cursor.fetchall()
df = pd.DataFrame(list(result))
name = ["name","near_city_name"]
df = df.rename(columns=dict(zip(list(range(len(name))), name)))
print(df.head(6))
print(df.shape)
df.to_csv('/tmp/city.csv',index=False)
def write_city():
a = [[1, '2', '3'], ['4', '5', '6']]
b = pd.DataFrame(a)
from sqlalchemy import create_engine
yconnect = create_engine('mysql+pymysql://root:3SYz54LS9#^9sBvC@10.66.157.22:4000/jerry_test?charset=utf8')
pd.io.sql.to_sql(df, table, yconnect, schema='jerry_test', if_exists='append', index=False)
if __name__ == "__main__":
get_city()
......@@ -67,7 +67,7 @@ rule = {"t1_"+str(sorted(boniaosuan)):1,
"t3_" + str(sorted(xizhishoushen)): 2,
"t4_" + str(sorted(xizhishoushen)): 3,
"t1_" + str(sorted(kangshuailao)): 1,
"t2_" + str(sorted(kangshuailao)): 2,
"t2_" + str(sorted(kangshuailao)): 1,
"t3_" + str(sorted(kangshuailao)): 2,
"t4_" + str(sorted(kangshuailao)): 3,
"t1_" + str(sorted(xiongbu)): 1,
......@@ -77,7 +77,7 @@ rule = {"t1_"+str(sorted(boniaosuan)):1,
"t1_" + str(sorted(yixuemeifu)): 1,
"t2_" + str(sorted(yixuemeifu)): 1,
"t3_" + str(sorted(yixuemeifu)): 2,
"t4_" + str(sorted(yixuemeifu)): 3,
"t4_" + str(sorted(yixuemeifu)): 2,
"t1_" + str(sorted(simi)): 1,
"t2_" + str(sorted(simi)): 1,
"t3_" + str(sorted(simi)): 2,
......@@ -85,7 +85,7 @@ rule = {"t1_"+str(sorted(boniaosuan)):1,
"t1_" + str(sorted(tuomao)): 1,
"t2_" + str(sorted(tuomao)): 2,
"t3_" + str(sorted(tuomao)): 2,
"t4_" + str(sorted(tuomao)): 3,
"t4_" + str(sorted(tuomao)): 2,
"t1_" + str(sorted(zhifa)): 1,
"t2_" + str(sorted(zhifa)): 2,
"t3_" + str(sorted(zhifa)): 2,
......@@ -105,7 +105,7 @@ rule = {"t1_"+str(sorted(boniaosuan)):1,
"t1_" + str(sorted(banyongjiuwenjiu)): 1,
"t2_" + str(sorted(banyongjiuwenjiu)): 2,
"t3_" + str(sorted(banyongjiuwenjiu)): 2,
"t4_" + str(sorted(banyongjiuwenjiu)): 3
"t4_" + str(sorted(banyongjiuwenjiu)): 2
}
tag_value["sort_rule"] = json.dumps(rule)
......
......@@ -31,11 +31,11 @@ xiongbu = [7,66,69,70,210,212,220,241,785,870,871,954,2354,5724,6144,6145,8710]
rule = {"t1_"+str(sorted(boniaosuan)):1,
"t2_"+str(sorted(boniaosuan)):1,
"t3_"+str(sorted(boniaosuan)):2,
"t4_"+str(sorted(boniaosuan)):3,
"t4_"+str(sorted(boniaosuan)):2,
"t1_"+str(sorted(chuzhoushoulian)):1,
"t2_"+str(sorted(chuzhoushoulian)):1,
"t3_"+str(sorted(chuzhoushoulian)):2,
"t4_"+str(sorted(chuzhoushoulian)):3,
"t4_"+str(sorted(chuzhoushoulian)):2,
"t1_"+str(sorted(bibu)):1,
"t2_"+str(sorted(bibu)):2,
"t3_"+str(sorted(bibu)):2,
......@@ -63,7 +63,7 @@ rule = {"t1_"+str(sorted(boniaosuan)):1,
"t1_" + str(sorted(kangshuaijinzhi)): 1,
"t2_" + str(sorted(kangshuaijinzhi)): 2,
"t3_" + str(sorted(kangshuaijinzhi)): 2,
"t4_" + str(sorted(kangshuaijinzhi)): 3,
"t4_" + str(sorted(kangshuaijinzhi)): 2,
"t1_" + str(sorted(yixuemeifu)): 1,
"t2_" + str(sorted(yixuemeifu)): 1,
"t3_" + str(sorted(yixuemeifu)): 2,
......@@ -83,7 +83,7 @@ rule = {"t1_"+str(sorted(boniaosuan)):1,
"t1_" + str(sorted(chunbu)): 1,
"t2_" + str(sorted(chunbu)): 2,
"t3_" + str(sorted(chunbu)): 2,
"t4_" + str(sorted(chunbu)): 3,
"t4_" + str(sorted(chunbu)): 2,
"t1_" + str(sorted(shibaixiufu)): 1,
"t2_" + str(sorted(shibaixiufu)): 2,
"t3_" + str(sorted(shibaixiufu)): 4,
......
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