Commit ff4a86ae by larosa

add push sku log

parent d4ab132c
create table lie_shop_push_sku_log (
id int unsigned auto_increment comment '主键id' primary key,
spu_id bigint unsigned default 0 not null comment 'SPUID',
sku_id bigint unsigned default 0 not null comment 'SKUID',
request_body_msg text not null comment '请求参数体信息',
resp_body_msg text not null comment '响应信息',
status int(10) default 0 not null comment '发品状态 0:失败 1:成功',
platform int(10) default 0 not null comment '第三方平台 1京东',
create_time int(10) default 0 not null comment '创建时间',
update_time int(10) default 0 not null comment '更新时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='sku推送日志表';
\ No newline at end of file
import pika
# 推送消息到 mq测试脚本
username = 'huntadmin'
password = 'jy2y2900'
host = '192.168.1.237'
port = 5672
queue_name = 'liexin_nplm_filter_sku_data'
def push_mq(message:str):
credentials = pika.PlainCredentials(username=username, password=password)
conn = pika.BlockingConnection(pika.ConnectionParameters(
host=host,
port=port,
credentials=credentials
))
channel = conn.channel()
channel.queue_declare(queue=queue_name, durable=True)
channel.basic_publish(body=str.encode(message))
channel.close()
conn.close()
if __name__ == '__main__':
pass
\ No newline at end of file
......@@ -16,4 +16,4 @@ if __name__ == '__main__':
print(json.dumps(ans, ensure_ascii=False))
# .\gf_windows_amd64.exe gen dao -l "mysql:liexin_data_distribution:liexin_data_distribution#zsyM@tcp(192.168.1.238:3306)/liexin_data_distribution" -t "lie_shop_picture" -r "lie_"
\ No newline at end of file
# .\gf_windows_amd64.exe gen dao -l "mysql:liexin_data_distribution:liexin_data_distribution#zsyM@tcp(192.168.1.238:3306)/liexin_data_distribution" -t "lie_shop_push_sku_log" -r "lie_"
\ No newline at end of file
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 sign in to comment