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.
Files changed (17) hide show
  1. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/PKG-INFO +1 -1
  2. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/LiveCommonInterface.py +21 -28
  3. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/PKG-INFO +1 -1
  4. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/setup.py +1 -1
  5. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/CommonOa.py +0 -0
  6. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/McCommonInterface.py +0 -0
  7. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/OperaMysql.py +0 -0
  8. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/OperaRedis.py +0 -0
  9. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/PostCommonInterface.py +0 -0
  10. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/ScPulsar.py +0 -0
  11. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/ScWebsocket.py +0 -0
  12. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface/__init__.py +0 -0
  13. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/SOURCES.txt +0 -0
  14. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/dependency_links.txt +0 -0
  15. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/requires.txt +0 -0
  16. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/sc_common_interface.egg-info/top_level.txt +0 -0
  17. {sc_common_interface-3.0.1 → sc_common_interface-3.0.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc_common_interface
3
- Version: 3.0.1
3
+ Version: 3.0.2
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -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
- time.sleep(5)
172
- response = requests.delete(url, headers=headers).json()
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
- response = requests.post(url, headers=headers).json()
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
- response = requests.post(url, headers=headers).json()
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
- 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I',
2544
- 'lang': 'en', 'Content-Type': 'application/json', 'user-agent': 'ShoplineQuality/1.5-python'},
2545
- 'activity_id': 10321186, 'env': 'https://front-admin-preview.shoplineapp.com',
2546
- 'body': {'businessSource': 'POST', 'duration': 600, 'lotteryMethod': 'ACTIVITY_END',
2547
- 'activityTitle': '接口创建留言抢优惠1747559554', 'businessId': 563929, 'activityType': 'LUCKY_DRAW',
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
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 3.0.1
3
+ Version: 3.0.2
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='sc_common_interface',
5
- version='3.0.1',
5
+ version='3.0.2',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),