sc-common-interface 2.8.3__tar.gz → 2.8.5__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.
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/PKG-INFO +1 -1
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/LiveCommonInterface.py +99 -26
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/setup.py +1 -1
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/CommonOa.py +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/Platform.py +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/setup.cfg +0 -0
{sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -1792,7 +1792,7 @@ def get_produnct_set_detail(data):
|
|
|
1792
1792
|
|
|
1793
1793
|
|
|
1794
1794
|
def add_product_set_to_live(data):
|
|
1795
|
-
"
|
|
1795
|
+
"添加组合商品到直播间"
|
|
1796
1796
|
env = data["env"]
|
|
1797
1797
|
headers = data["headers"]
|
|
1798
1798
|
sales_id = data["sales_id"]
|
|
@@ -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
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
"
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
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
|
|
@@ -2332,10 +2349,67 @@ def delete_product_by_keyword(data):
|
|
|
2332
2349
|
data["product_id"] = set_spu_id
|
|
2333
2350
|
delete_product_set(data)
|
|
2334
2351
|
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2352
|
+
def add_product_to_live(data):
|
|
2353
|
+
"添加普通商品到直播间"
|
|
2354
|
+
env = data["env"]
|
|
2355
|
+
headers = data["headers"]
|
|
2356
|
+
sales_id = data["sales_id"]
|
|
2357
|
+
keyword = ["pythonaddkeyword%d"%int(time.time())]
|
|
2358
|
+
keyword = data.get("keyword",keyword)
|
|
2359
|
+
url = "%s/api/posts/post/sales/%s/products"%(env,sales_id)
|
|
2360
|
+
product_id = data["product_id"]
|
|
2361
|
+
missCommonKey = data.get("missCommonKey",True)
|
|
2362
|
+
customNumber = data.get("customNumber",[])
|
|
2363
|
+
type = data.get("type","spu")
|
|
2364
|
+
if isinstance(keyword,str):
|
|
2365
|
+
keyword = [keyword]
|
|
2366
|
+
if isinstance(customNumber, str):
|
|
2367
|
+
customNumber = [customNumber]
|
|
2368
|
+
body = {
|
|
2369
|
+
"spuList": [
|
|
2370
|
+
{
|
|
2371
|
+
"spuId": product_id,
|
|
2372
|
+
"missCommonKey": missCommonKey,
|
|
2373
|
+
"customNumbers": customNumber,
|
|
2374
|
+
"keyList":keyword
|
|
2375
|
+
}
|
|
2376
|
+
]
|
|
2377
|
+
}
|
|
2378
|
+
if type=="sku":
|
|
2379
|
+
"""
|
|
2380
|
+
skuList 格式:
|
|
2381
|
+
[
|
|
2382
|
+
{
|
|
2383
|
+
"skuId": "67b5739c05e4b200102ae7bf",
|
|
2384
|
+
"missCommonKey": false,
|
|
2385
|
+
"keyList": [
|
|
2386
|
+
"fb直播间新增的对规格关键字17399448600"
|
|
2387
|
+
]
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
"skuId": "67b5739c05e4b200102ae7c0",
|
|
2391
|
+
"missCommonKey": false,
|
|
2392
|
+
"keyList": [
|
|
2393
|
+
"fb直播间新增的对规格关键字17399448601"
|
|
2394
|
+
]
|
|
2395
|
+
} ]
|
|
2396
|
+
"""
|
|
2397
|
+
skuList = data["skuList"]
|
|
2398
|
+
body = {
|
|
2399
|
+
"spuList": [
|
|
2400
|
+
{
|
|
2401
|
+
"spuId": product_id,
|
|
2402
|
+
"missCommonKey": missCommonKey,
|
|
2403
|
+
"customNumbers": customNumber,
|
|
2404
|
+
"skuList": skuList
|
|
2405
|
+
}
|
|
2406
|
+
]
|
|
2407
|
+
}
|
|
2408
|
+
#添加前先删除直播间的商品
|
|
2409
|
+
remove_live_product(data)
|
|
2410
|
+
print(body)
|
|
2411
|
+
response = requests.post(url,headers=headers,json=body).json()
|
|
2412
|
+
return response
|
|
2339
2413
|
|
|
2340
2414
|
|
|
2341
2415
|
|
|
@@ -2347,9 +2421,8 @@ def delete_product_by_keyword(data):
|
|
|
2347
2421
|
|
|
2348
2422
|
|
|
2349
2423
|
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', '
|
|
2351
|
-
|
|
2352
|
-
res = delete_product_by_keyword(data)
|
|
2424
|
+
data = {'env': 'https://front-admin-preview.shoplineapp.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I', 'lang': 'en'}, 'platform': 'FB_GROUP', 'sales_id': '95828', 'keyword': ['test关键字组件直播间新增的关键字1739955629'], 'product_id': '65bba57da79d260023ac30ff'}
|
|
2425
|
+
res = add_product_to_live(data)
|
|
2353
2426
|
print(res)
|
|
2354
2427
|
|
|
2355
2428
|
|
|
File without changes
|
{sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-2.8.3 → sc_common_interface-2.8.5}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|