代码优化
This commit is contained in:
parent
fa08c1372d
commit
f5cdc81404
|
|
@ -29,6 +29,8 @@ class GoodsInfo(BaseModel):
|
||||||
class DataReceive(BaseModel):
|
class DataReceive(BaseModel):
|
||||||
task_id: str = Field(..., description="任务ID")
|
task_id: str = Field(..., description="任务ID")
|
||||||
app_name: str = Field(..., description="应用名称")
|
app_name: str = Field(..., description="应用名称")
|
||||||
|
account_id: str = Field(..., description="使用账号")
|
||||||
|
pad_code: str = Field(..., description="设备编号")
|
||||||
shop_id: str = Field(..., description="店铺ID")
|
shop_id: str = Field(..., description="店铺ID")
|
||||||
item_id: str = Field(..., description="商品ID")
|
item_id: str = Field(..., description="商品ID")
|
||||||
region: str = Field(..., description="地区")
|
region: str = Field(..., description="地区")
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,9 @@ class AllTask:
|
||||||
affected_rows = self.redis_conn.write_data(key, params)
|
affected_rows = self.redis_conn.write_data(key, params)
|
||||||
if affected_rows:
|
if affected_rows:
|
||||||
print(f"{key};数据已存入redis中")
|
print(f"{key};数据已存入redis中")
|
||||||
params_data = {"item_id": data["item_id"], "shop_id": data["shop_id"], "region": data["region"], "app_name": data["app_name"],
|
params_data = {"item_id": data["item_id"], "shop_id": data["shop_id"], "region": data["region"],
|
||||||
|
"app_name": data["app_name"], "pad_code": data["pad_code"],
|
||||||
|
"account_id": data["account_id"],
|
||||||
"goods_info": json.dumps(params)}
|
"goods_info": json.dumps(params)}
|
||||||
try:
|
try:
|
||||||
affected_rows = await self.db_pool.insert_many(table='goods_information_record', data=[params_data])
|
affected_rows = await self.db_pool.insert_many(table='goods_information_record', data=[params_data])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue