sc-common-interface 3.0.1__tar.gz → 3.0.2__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.0.1 → sc_common_interface-3.0.2}/PKG-INFO +1 -1
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/LiveCommonInterface.py +21 -28
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/setup.py +1 -1
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/CommonOa.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/OperaMysql.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/OperaRedis.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/ScPulsar.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/ScWebsocket.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/setup.cfg +0 -0
{sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -167,9 +167,10 @@ def delate_activity(data):
|
|
|
167
167
|
env = data["env"]
|
|
168
168
|
headers = data["headers"]
|
|
169
169
|
activity_id = data["activity_id"]
|
|
170
|
-
url = "%s/api/activity/%s" % (env, activity_id)
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
url = "%s/admin/api/bff-web/live/activity/%s" % (env, activity_id)
|
|
171
|
+
body = {}
|
|
172
|
+
time.sleep(1)
|
|
173
|
+
response = requests.delete(url, headers=headers,json=body).json()
|
|
173
174
|
return response
|
|
174
175
|
|
|
175
176
|
|
|
@@ -177,8 +178,9 @@ def start_activity(data):
|
|
|
177
178
|
env = data["env"]
|
|
178
179
|
headers = data["headers"]
|
|
179
180
|
activity_id = data["activity_id"]
|
|
180
|
-
url = "%s/api/activity/%s/start" % (env, activity_id)
|
|
181
|
-
|
|
181
|
+
url = "%s/admin/api/bff-web/live/activity/%s/start" % (env, activity_id)
|
|
182
|
+
body = {}
|
|
183
|
+
response = requests.post(url, headers=headers,json=body).json()
|
|
182
184
|
return response
|
|
183
185
|
|
|
184
186
|
|
|
@@ -186,8 +188,9 @@ def end_activity(data):
|
|
|
186
188
|
env = data["env"]
|
|
187
189
|
headers = data["headers"]
|
|
188
190
|
activity_id = data["activity_id"]
|
|
189
|
-
url = "%s/api/activity/%s/end" % (env, activity_id)
|
|
190
|
-
|
|
191
|
+
url = "%s/admin/api/bff-web/live/activity/%s/end" % (env, activity_id)
|
|
192
|
+
body = {}
|
|
193
|
+
response = requests.post(url, headers=headers,json=body).json()
|
|
191
194
|
return response
|
|
192
195
|
|
|
193
196
|
|
|
@@ -292,6 +295,10 @@ def send__live_comment(data):
|
|
|
292
295
|
body = {"entry": [{"id": page_id, "time": stamp, "changes": [{"value": {
|
|
293
296
|
"from": {"id": user_id, "name": name}, "post_id": post_id, "created_time": stamp, "item": "reaction",
|
|
294
297
|
"parent_id": post_id, "reaction_type": "like", "verb": "add"}, "field": "feed"}]}], "object": "page"}
|
|
298
|
+
elif comment_type == "unlike":
|
|
299
|
+
body = {"entry": [{"id": page_id, "time": stamp, "changes": [{"value": {
|
|
300
|
+
"from": {"id": user_id, "name": name}, "post_id": post_id, "created_time": stamp, "item": "reaction",
|
|
301
|
+
"parent_id": post_id, "reaction_type": "like", "verb": "remove"}, "field": "feed"}]}], "object": "page"}
|
|
295
302
|
|
|
296
303
|
# print(body)
|
|
297
304
|
url = "%s/facebook/webhook" % env
|
|
@@ -2535,27 +2542,13 @@ def send_comment():
|
|
|
2535
2542
|
contentbody = json.dumps(contentbody)
|
|
2536
2543
|
headers = {"Content-Type": "application/json", "x-hub-signature": "sha1=%s" % signdata}
|
|
2537
2544
|
res = requests.post(url, headers=headers, data=contentbody)
|
|
2538
|
-
print(res.content)
|
|
2545
|
+
# print(res.content)
|
|
2539
2546
|
|
|
2540
2547
|
|
|
2541
2548
|
if __name__ == "__main__":
|
|
2542
|
-
data = {'headers': {
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
'totalWinner': 4,
|
|
2549
|
-
'message': {'winMessage': 'winMessage,联系客服领奖!', 'activityEndComment': '{title}活動結束 ,謝謝大家的熱情參與!',
|
|
2550
|
-
'winComment': '恭喜 {winner} 中獎,請於直播後與小編聯繫!',
|
|
2551
|
-
'activityStartComment': '{title} 活動開始 商家截止前留言關鍵字「{keyword}」即可參加抽獎'},
|
|
2552
|
-
'activityInfo': {'tagFriendsNum': 1, 'taskTypes': ['LIKED_POST'],
|
|
2553
|
-
'keyword': '接口自动化新增关键字1747559554202'}}, 'sales_id': 563929,
|
|
2554
|
-
'keyword': '接口自动化新增关键字1747559554202', 'key': '5e3bba98882fc0fb22a0607238bc5b8f'}
|
|
2555
|
-
data["keyword"] = "fsfsf"
|
|
2556
|
-
data["platform"] = "facebook"
|
|
2557
|
-
user_id, name, __ = send__live_comment(data)
|
|
2558
|
-
data["comment_type"] = "like"
|
|
2559
|
-
data["user_id"] = user_id
|
|
2560
|
-
data["name"] = name
|
|
2561
|
-
send__live_comment(data)
|
|
2549
|
+
data = {'env': 'https://front-admin-preview.shoplineapp.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIzMzA5NzFkNWE3ODIwYjBhN2Y1NjQzM2UyOGEwZDFmZSIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjYyN2M3NTBhMDYyMzcwMDAwYWZlNWVmZCJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.AmO49bUXC-bpV0Oij3FCHv5PDI728EhBnXm_sK-yyBE', 'lang': 'en', 'user-agent': 'ShoplineQuality/1.5-python'}, 'sales_id': 583226}
|
|
2550
|
+
data["activity_id"] = 10324333
|
|
2551
|
+
res = start_activity(data)
|
|
2552
|
+
print(res)
|
|
2553
|
+
|
|
2554
|
+
|
|
File without changes
|
{sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|