sc-common-interface 2.8.2__tar.gz → 2.8.3__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.2 → sc_common_interface-2.8.3}/PKG-INFO +1 -1
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/LiveCommonInterface.py +51 -8
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/setup.py +1 -1
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/CommonOa.py +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/Platform.py +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/setup.cfg +0 -0
{sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -2296,16 +2296,60 @@ def get_not_exist_keyword_set(data):
|
|
|
2296
2296
|
pageNum += 1
|
|
2297
2297
|
data["pageNum"] = pageNum
|
|
2298
2298
|
|
|
2299
|
+
def search_product_by_keyword(data):
|
|
2300
|
+
env = data["env"]
|
|
2301
|
+
headers = data["headers"]
|
|
2302
|
+
keyword = data["keyword"]
|
|
2303
|
+
sales_id = data["sales_id"]
|
|
2304
|
+
url = "%s/api/posts/post/sales/%s/product/v2" % (env, sales_id)
|
|
2305
|
+
param = {"salesId": sales_id, "pageIndex": 1, "pageSize": 25, "query": keyword, "queryType": "KEYWORD"}
|
|
2306
|
+
response = requests.get(url, headers=headers, params=param).json()
|
|
2307
|
+
return response
|
|
2308
|
+
|
|
2309
|
+
def search_product_set_by_keyword(data):
|
|
2310
|
+
env = data["env"]
|
|
2311
|
+
headers = data["headers"]
|
|
2312
|
+
keyword = data["keyword"]
|
|
2313
|
+
sales_id = data["sales_id"]
|
|
2314
|
+
url = "%s/admin/api/bff-web/live/sale/%s/sale_list/product_set" % (env, sales_id)
|
|
2315
|
+
param = { "pageNum": 1, "pageSize": 25, "query": keyword, "queryType": "KEYWORD"}
|
|
2316
|
+
response = requests.get(url, headers=headers, params=param).json()
|
|
2317
|
+
return response
|
|
2318
|
+
|
|
2319
|
+
|
|
2320
|
+
def delete_product_by_keyword(data):
|
|
2321
|
+
"""根据关键字查询出商品,删除该普通商品和组合商品"""
|
|
2322
|
+
response = search_product_by_keyword(data)
|
|
2323
|
+
result = response["data"]["product_page_result"]["list"]
|
|
2324
|
+
if len(result)>0:
|
|
2325
|
+
spu_id = result[0]["spu_id"]
|
|
2326
|
+
data["product_id"] = spu_id
|
|
2327
|
+
remove_live_product(data)
|
|
2328
|
+
set_response = search_product_set_by_keyword(data)
|
|
2329
|
+
set_result = set_response["data"]["list"]
|
|
2330
|
+
if len(set_result)>0:
|
|
2331
|
+
set_spu_id = set_result[0]["id"]
|
|
2332
|
+
data["product_id"] = set_spu_id
|
|
2333
|
+
delete_product_set(data)
|
|
2334
|
+
|
|
2335
|
+
|
|
2336
|
+
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
|
|
2340
|
+
|
|
2341
|
+
|
|
2342
|
+
|
|
2343
|
+
|
|
2344
|
+
|
|
2345
|
+
|
|
2346
|
+
|
|
2299
2347
|
|
|
2300
2348
|
|
|
2301
2349
|
if __name__=="__main__":
|
|
2302
|
-
data = {'env': 'https://front-admin-preview.shoplineapp.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I', 'lang': 'en'}, '
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
data["product_id"] = [product_id]
|
|
2306
|
-
delete_keyword_product_set(data)
|
|
2307
|
-
data["product_id"] = product_id
|
|
2308
|
-
__,__,__,res = add_product_set_to_live(data)
|
|
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)
|
|
2309
2353
|
print(res)
|
|
2310
2354
|
|
|
2311
2355
|
|
|
@@ -2320,4 +2364,3 @@ if __name__=="__main__":
|
|
|
2320
2364
|
|
|
2321
2365
|
|
|
2322
2366
|
|
|
2323
|
-
|
|
File without changes
|
{sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-2.8.2 → sc_common_interface-2.8.3}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|