sc-common-interface 2.6.0__tar.gz → 2.6.1__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.6.0 → sc-common-interface-2.6.1}/PKG-INFO +1 -1
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface/LiveCommonInterface.py +62 -6
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface/PostCommonInterface.py +3 -1
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/setup.py +1 -1
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface/McCommonInterface.py +0 -0
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/setup.cfg +0 -0
{sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -9,6 +9,60 @@ from hashlib import sha1
|
|
|
9
9
|
import random
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_sales_id(data):
|
|
15
|
+
""""查询返回指定直播间的salse_id
|
|
16
|
+
status:准备中 0,直播中 1 已结束 2 断线中 4
|
|
17
|
+
"""
|
|
18
|
+
env = data["env"]
|
|
19
|
+
headers = data["headers"]
|
|
20
|
+
url = "%s/api/posts/post/sales"%env
|
|
21
|
+
param = {"page_num":1,"page_size":100,"sales_type":"LIVE"}
|
|
22
|
+
platform = "LINE"
|
|
23
|
+
if "platform" in data:
|
|
24
|
+
platform = data["platform"].upper()
|
|
25
|
+
param["platforms"] = platform
|
|
26
|
+
if "search" in data:
|
|
27
|
+
search_word = data["search"]
|
|
28
|
+
param["search_word"] = search_word
|
|
29
|
+
response = requests.get(url,headers=headers,params=param).json()
|
|
30
|
+
# print("url",url)
|
|
31
|
+
# print("param", param)
|
|
32
|
+
# print("response",response)
|
|
33
|
+
sales_data = response["data"]["list"]
|
|
34
|
+
if "status" in data:
|
|
35
|
+
status = data["status"]
|
|
36
|
+
for i in sales_data:
|
|
37
|
+
platforms = i["platforms"]
|
|
38
|
+
post_sale_status = i["post_sale_status"]
|
|
39
|
+
if platforms == [platform.upper()] and post_sale_status == status:
|
|
40
|
+
sales_id = i["id"]
|
|
41
|
+
data["sales_id"] = sales_id
|
|
42
|
+
if "type" in data:
|
|
43
|
+
type = data["type"]
|
|
44
|
+
response = get_live_info(data)
|
|
45
|
+
platform_sub_type = response["data"]["sales"]["platform_sub_type"]
|
|
46
|
+
if platform_sub_type == type.upper():
|
|
47
|
+
return sales_id, response
|
|
48
|
+
else:
|
|
49
|
+
return sales_id, response
|
|
50
|
+
else:
|
|
51
|
+
for i in sales_data:
|
|
52
|
+
platforms = i["platforms"]
|
|
53
|
+
if platforms == [platform.upper()]:
|
|
54
|
+
sales_id = i["id"]
|
|
55
|
+
data["sales_id"] = sales_id
|
|
56
|
+
if "type" in data:
|
|
57
|
+
type = data["type"]
|
|
58
|
+
response = get_live_info(data)
|
|
59
|
+
platform_sub_type = response["data"]["sales"]["platform_sub_type"]
|
|
60
|
+
if platform_sub_type == type.upper():
|
|
61
|
+
return sales_id, response
|
|
62
|
+
else:
|
|
63
|
+
return sales_id, response
|
|
64
|
+
|
|
65
|
+
|
|
12
66
|
def create_activity(data):
|
|
13
67
|
env = data["env"]
|
|
14
68
|
headers = data["headers"]
|
|
@@ -66,7 +120,7 @@ def send__live_comment(data):
|
|
|
66
120
|
post_id = data['post_id']
|
|
67
121
|
if "group_id" in data:
|
|
68
122
|
post_id = data['group_id']
|
|
69
|
-
if page_id == "" or post_id == "":
|
|
123
|
+
if page_id == "" or post_id == "key":
|
|
70
124
|
info = get_live_info(data)
|
|
71
125
|
platform_list = jsonpath(info, "$..relatedPostList..platform")
|
|
72
126
|
i = platform_list.index(platform.upper())
|
|
@@ -718,7 +772,7 @@ def create_live(data):
|
|
|
718
772
|
else:
|
|
719
773
|
count=count+1
|
|
720
774
|
if count>10:
|
|
721
|
-
return
|
|
775
|
+
return 1000
|
|
722
776
|
|
|
723
777
|
# print(json.dumps(body))
|
|
724
778
|
|
|
@@ -1445,6 +1499,7 @@ def remove_live_product(data):
|
|
|
1445
1499
|
|
|
1446
1500
|
|
|
1447
1501
|
def change_keyword_status(data):
|
|
1502
|
+
"""生效普通商品状态"""
|
|
1448
1503
|
env = data["env"]
|
|
1449
1504
|
headers = data["headers"]
|
|
1450
1505
|
sales_id = data["sales_id"]
|
|
@@ -1744,7 +1799,7 @@ def add_all_product_set_to_live(data):
|
|
|
1744
1799
|
print("出现异常")
|
|
1745
1800
|
lastPage = set_list_res["data"]["pageInfo"]["lastPage"]
|
|
1746
1801
|
pageNum = set_list_res["data"]["pageInfo"]["pageNum"]
|
|
1747
|
-
print("加前的pagenum",pageNum)
|
|
1802
|
+
# print("加前的pagenum",pageNum)
|
|
1748
1803
|
# print(lastPage)
|
|
1749
1804
|
if lastPage == False:
|
|
1750
1805
|
pageNum = pageNum + 1
|
|
@@ -1753,7 +1808,8 @@ def add_all_product_set_to_live(data):
|
|
|
1753
1808
|
else:
|
|
1754
1809
|
break
|
|
1755
1810
|
|
|
1811
|
+
|
|
1812
|
+
|
|
1813
|
+
|
|
1756
1814
|
if __name__=="__main__":
|
|
1757
|
-
|
|
1758
|
-
a+=1
|
|
1759
|
-
print(a)
|
|
1815
|
+
pass
|
{sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.6.0 → sc-common-interface-2.6.1}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|