sc-common-interface 2.3.5__tar.gz → 2.3.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.3.5
3
+ Version: 2.3.6
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -1164,6 +1164,9 @@ def modelone_create_single_product(data):
1164
1164
  env = data["env"]
1165
1165
  headers = data["headers"]
1166
1166
  sales_id = data["sales_id"]
1167
+ quantity = 1000
1168
+ if "quantity" in data:
1169
+ quantity = data["quantity"]
1167
1170
  url = "%s/api/posts/post/sales/%s/product/create" % (env, sales_id)
1168
1171
  product_name = "post接口新增商品多规格商品名称%d" % int(time.time())
1169
1172
  if "product_name" in data:
@@ -1171,12 +1174,38 @@ def modelone_create_single_product(data):
1171
1174
  keyword = "post接口新增商品多规格商品关键字%d" % int(time.time())
1172
1175
  if "keyword" in data:
1173
1176
  keyword = data["keyword"]
1174
- body = {"customKey":keyword,"quantity":5,"unlimitedQuantity":False,"productName":product_name,
1177
+ body = {"customKey":keyword,"quantity":quantity,"unlimitedQuantity":False,"productName":product_name,
1175
1178
  "imageUrl":"https://s3-ap-southeast-1.amazonaws.com/static.shoplineapp.com/sc-admin/product-default.png","price":3}
1176
1179
  response = requests.post(url,headers=headers,json=body).json()
1177
1180
  spu_id = response["data"]
1178
1181
  return spu_id
1179
1182
 
1183
+ def modelfour_create_single_product(data):
1184
+ """
1185
+ 贴文新增无规格商品
1186
+ :param data:
1187
+ :return: 返回新增的商品的spu_id
1188
+ """
1189
+ env = data["env"]
1190
+ headers = data["headers"]
1191
+ sales_id = data["sales_id"]
1192
+ quantity = 1000
1193
+ if "quantity" in data:
1194
+ quantity = data["quantity"]
1195
+ url = "%s/api/posts/post/sales/%s/product/create" % (env, sales_id)
1196
+ product_name = "post接口新增商品多规格商品名称%d" % int(time.time())
1197
+ if "product_name" in data:
1198
+ product_name = data["product_name"]
1199
+ keyword = "post接口新增商品多规格商品关键字%d" % int(time.time())
1200
+ if "keyword" in data:
1201
+ keyword = data["keyword"]
1202
+ body = {"customNumber":keyword,"quantity":quantity,"unlimitedQuantity":False,"productName":product_name,
1203
+ "imageUrl":"https://s3-ap-southeast-1.amazonaws.com/static.shoplineapp.com/sc-admin/product-default.png","price":3}
1204
+ response = requests.post(url,headers=headers,json=body).json()
1205
+ spu_id = response["data"]
1206
+ return spu_id
1207
+
1208
+
1180
1209
  def modelone_create_mutil_product(data):
1181
1210
  """
1182
1211
  贴文新增多规格商品,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.3.5
3
+ Version: 2.3.6
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='sc-common-interface',
5
- version='2.3.5',
5
+ version='2.3.6',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),