rambo 3 周之前
父节点
当前提交
8204d3ed3c
共有 2 个文件被更改,包括 15 次插入24 次删除
  1. 13 2
      python/service/online_request/module_online_data.py
  2. 2 22
      python/temp.py

+ 13 - 2
python/service/online_request/module_online_data.py

@@ -627,7 +627,7 @@ class OnlineDataRequest(object):
                 for skuIdx, sku_data in enumerate(sku_list_basic):
                     sku_goods_art_no = sku_data.get("货号", "")
                     color_name = sku_data.get("颜色名称", "")
-                    size = sku_data.get("尺码", "")
+                    size = sku_data.get("尺码", 37)
                     # 尺码
                     mainImages = sku_data.get("800x800", [])
                     if not mainImages:
@@ -660,7 +660,7 @@ class OnlineDataRequest(object):
                     }
                     skuPropValueList.append(
                         {
-                            "imageJson": imageJson,
+                            "imageJson": [imageJson],
                             "propValue": str(color_name),
                             "showOrder": 1,
                         }
@@ -673,6 +673,17 @@ class OnlineDataRequest(object):
                         "skuPropValueList": skuPropValueList,
                     }
                 )
+                itemSkuImageList.append(
+                    {
+                        "propName": "尺码",
+                        "isImageProp": 1,
+                        "propShowOrder": 1,
+                        "skuPropValueList": [
+                            {"propValue": str(37),
+                            "showOrder": 1}
+                            ],
+                    }
+                )
                 detailImageUrl = self.uploadImage(local_path=detail_path)
                 category_info = "流行男鞋>>休闲鞋>>时尚休闲鞋"
                 itemData = {

+ 2 - 22
python/temp.py

@@ -2,25 +2,5 @@
 # from settings import recordDataPoint
 import time
 from service.online_request.module_online_data import OnlineDataRequest,AIGCDataRequest
-aigc = AIGCDataRequest("Bearer f99e72d818b504d23e0581ef1b1a2b4bb687c683")
-# status, result_image = aigc.searchProgress(1127984)
-# print(status,result_image)
-search_times = 60
-while search_times > 0:
-            print(f"模特图查询第{search_times}次")
-            # logger.info(f"模特图查询第{search_times}次")
-            status, result_image = aigc.searchProgress(1127989)
-            # status: -1=失败, 0=排队中, 1=进行中, 2=完成
-            if status == 2:  # 完成
-                break
-            if status == -1:  # 失败
-                break
-            # status为0(排队中)或1(进行中)时继续查询
-            time.sleep(1)
-            search_times -= 1
-        # 循环结束后检查最终状态
-if status == -1 or (status != 2 and search_times <= 0):
-    print("模特图生成失败")
-    exit()
-# save_image_path = download_image_with_pil(result_image, save_path)
-print("上脚图save_image_path",result_image)
+aigc = OnlineDataRequest("Bearer f99e72d818b504d23e0581ef1b1a2b4bb687c683")
+aigc.uploadGoods2ThirdParty("",["惠利玛@拼多多"])