Commit 7566e7fa by 岳巧源

add readme

parent 18059b29
Showing with 12 additions and 13 deletions
主要处理京东分类,属性,品牌等数据 主要处理京东分类,属性,品牌等数据
需要定时将京东数据更新到本地db中。 需要定时将京东数据更新到本地db中。
推送组装好的数据到rabbitmq队列中,go_nplm_server 负责消费数据,并将sku发布到京东平台
sku组装过程: 整体架构
1、首先从redis(235主机)中获取到 platform_id, shop_id, supplier_id, brand_id 等信息。\ go_nplm_server中写一个go命令(作为rabbit_mq的 producer)
2、根据获取到的supplier_id 去db中筛选数据(包含spu_id)\ 用于定时获取redis中数据。包含supplier_id, brand_id 等信息。
3、根据上面筛选到的数据 去redis中 查询对应spu_id 的数据信息。 根据这些信息去mysql中查询符合条件的 goods_id 和 spu_id
上述步骤拿到的goods_id 以及 spu_id 会传送到 rabbit_mq 队列当中。
TODO 暂时未解决(或未确认)的问题: rabbit_mq的 consumer
1. 型号是否是spu_name ?? 根据拿到的
2. 图片使用基石的默认图片 ??
3. 价格
...@@ -15,8 +15,8 @@ def get_channel_info(): ...@@ -15,8 +15,8 @@ def get_channel_info():
"""return supplier_id 或者 brand_id 等等""" """return supplier_id 或者 brand_id 等等"""
data = {} data = {}
infos = db.hgetall('shop_distribution') infos = db.hgetall('shop_distribution')
for i in range(len(infos)): for key in infos:
info_value = json.loads(infos[str(i+1)]) info_value = json.loads(infos[key])
# 暂时只推京东数据 # 暂时只推京东数据
if info_value["shop_id"] != 1 or info_value["platform"] != 1: if info_value["shop_id"] != 1 or info_value["platform"] != 1:
continue continue
...@@ -50,5 +50,6 @@ def get_class_from_rds(spu_id): ...@@ -50,5 +50,6 @@ def get_class_from_rds(spu_id):
if __name__ == '__main__': if __name__ == '__main__':
condition = get_channel_info() condition = get_channel_info()
spu_ids = period_get_data("liexin_sku_0", "lie_sku_0", condition) spu_ids = period_get_data("liexin_sku_0", "lie_sku_0", condition)
print(spu_ids)
infos = get_class_from_rds(spu_ids[0]) infos = get_class_from_rds(spu_ids[0])
print(type(infos)) print(infos)
\ No newline at end of file \ 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