sc-common-interface 2.8.3__tar.gz → 2.8.4__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.8.3
3
+ Version: 2.8.4
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -1838,24 +1838,41 @@ def add_product_set_to_live(data):
1838
1838
 
1839
1839
  url = "%s/admin/api/bff-web/live/sale/%s/sale_list/product_set" % (env, sales_id)
1840
1840
  # keyword = "python添加商品关键子%d" % int(time.time())
1841
- add_body = {
1842
- "spuList": [
1843
- {
1844
- "id": "%s" % product_id,
1845
- "defaultKey": "",
1846
- "combinationList": [
1847
- {
1848
- "products": products,
1849
- "keywords": [
1850
- "%s" % keyword
1851
- ],
1852
- "skuId": ""
1853
- }
1854
- ]
1855
- }
1856
- ]
1857
- }
1858
- # print(add_body)
1841
+ if isinstance(keyword,str):
1842
+ add_body = {
1843
+ "spuList": [
1844
+ {
1845
+ "id": "%s" % product_id,
1846
+ "defaultKey": "",
1847
+ "combinationList": [
1848
+ {
1849
+ "products": products,
1850
+ "keywords": [
1851
+ "%s" % keyword
1852
+ ],
1853
+ "skuId": ""
1854
+ }
1855
+ ]
1856
+ }
1857
+ ]
1858
+ }
1859
+ else:
1860
+ add_body = {
1861
+ "spuList": [
1862
+ {
1863
+ "id": "%s" % product_id,
1864
+ "defaultKey": "",
1865
+ "combinationList": [
1866
+ {
1867
+ "products": products,
1868
+ "keywords": keyword,
1869
+ "skuId": ""
1870
+ }
1871
+ ]
1872
+ }
1873
+ ]
1874
+ }
1875
+ print(add_body)
1859
1876
  try:
1860
1877
  #先删除再添加
1861
1878
  data["product_id"] = product_id
@@ -2347,9 +2364,8 @@ def delete_product_by_keyword(data):
2347
2364
 
2348
2365
 
2349
2366
  if __name__=="__main__":
2350
- data = {'env': 'https://front-admin-preview.shoplineapp.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I', 'lang': 'en'}, 'sales_id': '95828', 'product_id': '670fc567b7b2cb000a26ab86', 'keyword': 'fb直播间新增的关键字1739275716'}
2351
- data["keyword"] = "接口自动化添加的关键字1706796410"
2352
- res = delete_product_by_keyword(data)
2367
+ data = {'headers': {'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I', 'lang': 'en', 'Content-Type': 'application/json'}, 'product_id': '6787314d323be4000e158d6a', 'env': 'https://front-admin-preview.shoplineapp.com', 'keyword': ['jfjsdjfdfhhdaewqeqe',"ndhsahdsd"], 'sales_id': '95828'}
2368
+ __,__,keyword,res = add_product_set_to_live(data)
2353
2369
  print(res)
2354
2370
 
2355
2371
 
@@ -2364,3 +2380,4 @@ if __name__=="__main__":
2364
2380
 
2365
2381
 
2366
2382
 
2383
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.8.3
3
+ Version: 2.8.4
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.8.3',
5
+ version='2.8.4',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),