sc-common-interface 3.2.2__tar.gz → 3.2.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.
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/PKG-INFO +1 -1
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/LiveCommonInterface.py +14 -9
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/setup.py +1 -1
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/CommonOa.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/OperaMysql.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/OperaRedis.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/ScPulsar.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/ScWebsocket.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/pra.py +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/setup.cfg +0 -0
{sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -1878,7 +1878,7 @@ def get_produnct_set_detail(data):
|
|
|
1878
1878
|
if isinstance(product_id, list):
|
|
1879
1879
|
product_id = product_id[0]
|
|
1880
1880
|
url = "%s/admin/api/bff-web/live/sale/%s/product/product_set/%s" % (env, sales_id, product_id)
|
|
1881
|
-
print(url)
|
|
1881
|
+
# print(url)
|
|
1882
1882
|
count = 0
|
|
1883
1883
|
while True:
|
|
1884
1884
|
response = requests.get(url, headers=headers)
|
|
@@ -1899,6 +1899,7 @@ def add_product_set_to_live(data):
|
|
|
1899
1899
|
sales_id = data["sales_id"]
|
|
1900
1900
|
keyword = data.get("keyword", "python添加商品关键子%d" % int(time.time()))
|
|
1901
1901
|
product_id = data.get("product_id", "")
|
|
1902
|
+
title = ""
|
|
1902
1903
|
if product_id == "":
|
|
1903
1904
|
set_list_res = get_product_set(data)
|
|
1904
1905
|
data_list = set_list_res["data"]["list"]
|
|
@@ -1916,7 +1917,7 @@ def add_product_set_to_live(data):
|
|
|
1916
1917
|
data["product_id"] = product_id
|
|
1917
1918
|
# 查询组合商品详情信息
|
|
1918
1919
|
response = get_produnct_set_detail(data)
|
|
1919
|
-
print(response)
|
|
1920
|
+
# print(response)
|
|
1920
1921
|
products = []
|
|
1921
1922
|
zi_list = response["data"]
|
|
1922
1923
|
# print(zi_list)
|
|
@@ -1938,11 +1939,14 @@ def add_product_set_to_live(data):
|
|
|
1938
1939
|
|
|
1939
1940
|
url = "%s/admin/api/bff-web/live/sale/%s/sale_list/product_set" % (env, sales_id)
|
|
1940
1941
|
# keyword = "python添加商品关键子%d" % int(time.time())
|
|
1942
|
+
# print(type(product_id))
|
|
1943
|
+
if isinstance(product_id,list):
|
|
1944
|
+
product_id = product_id[0]
|
|
1941
1945
|
if isinstance(keyword, str):
|
|
1942
1946
|
add_body = {
|
|
1943
1947
|
"spuList": [
|
|
1944
1948
|
{
|
|
1945
|
-
"id":
|
|
1949
|
+
"id": "%s" % product_id,
|
|
1946
1950
|
"defaultKey": "",
|
|
1947
1951
|
"combinationList": [
|
|
1948
1952
|
{
|
|
@@ -1979,10 +1983,10 @@ def add_product_set_to_live(data):
|
|
|
1979
1983
|
delete_product_set(data)
|
|
1980
1984
|
time.sleep(2)
|
|
1981
1985
|
data_res = requests.post(url, headers=headers, json=add_body).json()
|
|
1982
|
-
|
|
1986
|
+
print("data_res:",data_res)
|
|
1983
1987
|
return product_id, products, keyword, title, data_res
|
|
1984
|
-
except Exception:
|
|
1985
|
-
print("
|
|
1988
|
+
except Exception as e:
|
|
1989
|
+
print("出现异常:%s"%e)
|
|
1986
1990
|
|
|
1987
1991
|
|
|
1988
1992
|
def add_all_product_set_to_live(data):
|
|
@@ -2453,8 +2457,8 @@ def search_product_by_keyword(data):
|
|
|
2453
2457
|
headers = data["headers"]
|
|
2454
2458
|
keyword = data["keyword"]
|
|
2455
2459
|
sales_id = data["sales_id"]
|
|
2456
|
-
url = "%s/admin/api/bff-web/live/sale/%s/
|
|
2457
|
-
param = {"salesId": sales_id, "
|
|
2460
|
+
url = "%s/admin/api/bff-web/live/sale/%s/sale_list/product" % (env, sales_id)
|
|
2461
|
+
param = {"salesId": sales_id, "pageIndex": 1, "pageSize": 20, "query": keyword, "queryType": "KEYWORD"}
|
|
2458
2462
|
response = requests.get(url, headers=headers, params=param).json()
|
|
2459
2463
|
return response
|
|
2460
2464
|
|
|
@@ -2772,7 +2776,8 @@ def get_live_global(data):
|
|
|
2772
2776
|
|
|
2773
2777
|
|
|
2774
2778
|
if __name__ == "__main__":
|
|
2775
|
-
|
|
2779
|
+
data = {'env': 'https://front-admin.shoplineapp.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIyNGUyMDgwMzdlNzIwYjMzOTI0ZmIwZDA4NTI0ZWVjYSIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWIwOTZiZWI3YmVmMTAwMjQ1ZGJkOGIiLCJhcHBsaWNhdGlvbl9pZCI6IjYyN2M3NTBhMDYyMzcwMDAwYWZlNWVmZCJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMuc2hvcGxpbmVhcHAuY29tIiwiYXVkIjpbXSwic3ViIjoiNjFiMDk2YmViN2JlZjEwMDI0NWRiZDhiIn0.9cBfiBZknZgL37b5A9rhcFQ77mvuXzXtt1Jt4gEH6yY', 'lang': 'en', 'user-agent': 'ShoplineQuality/1.5-python'}, 'sales_id': '592994', 'product_id': ['6954d7d8e8dca48f36f3988b'], 'keyword': '无规格商品前和后关键字1789825147'}
|
|
2780
|
+
delete_product_by_keyword(data)
|
|
2776
2781
|
|
|
2777
2782
|
|
|
2778
2783
|
|
|
File without changes
|
{sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-3.2.2 → sc_common_interface-3.2.4}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|