sc-common-interface 2.7.3__tar.gz → 2.7.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-2.7.3 → sc_common_interface-2.7.4}/PKG-INFO +1 -1
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface/LiveCommonInterface.py +15 -12
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/setup.py +1 -1
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface/Platform.py +0 -0
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/setup.cfg +0 -0
{sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -24,9 +24,7 @@ def delete_relate_post(data):
|
|
|
24
24
|
env = data["env"]
|
|
25
25
|
headers = data["headers"]
|
|
26
26
|
url = "%s/api/posts/post/sales" % env
|
|
27
|
-
sales_type = "LIVE"
|
|
28
|
-
if "sales_type" in data:
|
|
29
|
-
sales_type = data["sales_type"]
|
|
27
|
+
sales_type = data.get("sales_type","LIVE")
|
|
30
28
|
param = {"page_num": 1, "page_size": 100, "sales_type": sales_type}
|
|
31
29
|
platform = "facebook"
|
|
32
30
|
post_id = data["post_id"]
|
|
@@ -227,22 +225,22 @@ def send__live_comment(data):
|
|
|
227
225
|
platform = data.get("platform", "FACEBOOK")
|
|
228
226
|
post_id = data.get("post_id", "")
|
|
229
227
|
group_id = data.get("group_id", "")
|
|
230
|
-
# sales_type = data.get("sales_type", "live")
|
|
231
|
-
if page_id == "" or post_id == "key":
|
|
232
|
-
page_info = get_page_info(data)
|
|
233
|
-
platform = page_info["platform"]
|
|
234
|
-
post_id = page_info["post_id"]
|
|
235
|
-
group_id = page_info["group_id"]
|
|
236
228
|
stamp = int(time.time())
|
|
237
229
|
num = random.randint(100000, 999999)
|
|
238
230
|
user_id = "488864%d" % int(time.time())
|
|
239
231
|
name = "test live%d" % int(time.time())
|
|
240
232
|
comment_id = "%s_%d%d" % (page_id, stamp, num)
|
|
241
233
|
keyword = "接口测试普通留言"
|
|
242
|
-
user_id = data.get("user_id",user_id)
|
|
234
|
+
user_id = data.get("user_id", user_id)
|
|
243
235
|
name = data.get("name", name)
|
|
244
236
|
comment_id = data.get("comment_id", comment_id)
|
|
245
237
|
keyword = data.get("keyword", keyword)
|
|
238
|
+
# sales_type = data.get("sales_type", "live")
|
|
239
|
+
if page_id == "" or post_id == "key":
|
|
240
|
+
page_info = get_page_info(data)
|
|
241
|
+
platform = page_info["platform"]
|
|
242
|
+
post_id = page_info["post_id"]
|
|
243
|
+
group_id = page_info["group_id"]
|
|
246
244
|
|
|
247
245
|
body = {"object": "page", "entry": [{"id": page_id, "time": stamp, "changes": [{"field": "feed", "value": {
|
|
248
246
|
"from": {"id": user_id, "name": name},
|
|
@@ -300,6 +298,7 @@ def send_mc_message(data):
|
|
|
300
298
|
platform = data.get("platform", "FACEBOOK")
|
|
301
299
|
if page_id=="":
|
|
302
300
|
page_info = get_page_info(data)
|
|
301
|
+
page_id = page_info["page_id"]
|
|
303
302
|
platform = page_info["platform"]
|
|
304
303
|
post_id = page_info["post_id"]
|
|
305
304
|
group_id = page_info["group_id"]
|
|
@@ -352,10 +351,11 @@ def get_live_info(data):
|
|
|
352
351
|
if response.status_code==200:
|
|
353
352
|
return response.json()
|
|
354
353
|
else:
|
|
354
|
+
time.sleep(1)
|
|
355
355
|
count=count+1
|
|
356
356
|
if count>10:
|
|
357
357
|
print("查询报错:",response)
|
|
358
|
-
return response
|
|
358
|
+
return response.content
|
|
359
359
|
|
|
360
360
|
|
|
361
361
|
|
|
@@ -2013,7 +2013,10 @@ def handler_auto_reply(data):
|
|
|
2013
2013
|
|
|
2014
2014
|
|
|
2015
2015
|
if __name__=="__main__":
|
|
2016
|
-
|
|
2016
|
+
data = {'headers': {'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I', 'lang': 'en', 'Content-Type': 'application/json'}, 'auto_reply_id': '1883003621597597697', 'env': 'https://front-admin-preview.shoplineapp.com', 'sales_id': '95828', 'keyword': 'hello1737778021', 'post_id': '108513131786753_770459907444238', 'platform': 'facebook', 'page_id': '108513131786753', 'key': '5e3bba98882fc0fb22a0607238bc5b8f', 'user_id': '4888641737778025'}
|
|
2017
|
+
data["keyword"] ="hhkfasfjasfjashfahfagagag"
|
|
2018
|
+
user_id, name, comment_id = send__live_comment(data)
|
|
2019
|
+
print(name)
|
|
2017
2020
|
|
|
2018
2021
|
|
|
2019
2022
|
|
{sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-2.7.3 → sc_common_interface-2.7.4}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|