sc-common-interface 2.9.9__tar.gz → 3.0.0__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-2.9.9 → sc_common_interface-3.0.0}/PKG-INFO +1 -1
  2. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/LiveCommonInterface.py +13 -0
  3. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface.egg-info/PKG-INFO +1 -1
  4. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/setup.py +1 -1
  5. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/CommonOa.py +0 -0
  6. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/McCommonInterface.py +0 -0
  7. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/OperaMysql.py +0 -0
  8. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/OperaRedis.py +0 -0
  9. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/PostCommonInterface.py +0 -0
  10. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/ScPulsar.py +0 -0
  11. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/ScWebsocket.py +0 -0
  12. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface/__init__.py +0 -0
  13. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface.egg-info/SOURCES.txt +0 -0
  14. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface.egg-info/dependency_links.txt +0 -0
  15. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface.egg-info/requires.txt +0 -0
  16. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/sc_common_interface.egg-info/top_level.txt +0 -0
  17. {sc_common_interface-2.9.9 → sc_common_interface-3.0.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc_common_interface
3
- Version: 2.9.9
3
+ Version: 3.0.0
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -235,6 +235,7 @@ def send__live_comment(data):
235
235
  keyword = data.get("keyword", keyword)
236
236
  # sales_type = data.get("sales_type", "live")
237
237
  relationUrl = data.get("relationUrl","")
238
+ comment_type = data.get("comment_type","comment")
238
239
  if page_id == "" or post_id == "key":
239
240
  page_info = get_page_info(data)
240
241
  page_id = page_info["page_id"]
@@ -272,6 +273,18 @@ def send__live_comment(data):
272
273
  body = {"object":"page","entry":[{"id":page_id,"time":t_time,"messaging":[{"recipient":{"id":page_id},"message":keyword,
273
274
  "from":{"id":user_id,"name":name},"group_id":group_id,"post_id":post_id,"comment_id":comment_id,"created_time":stamp,"item":"comment",
274
275
  "verb":"add","parent_id":post_id,"field":"group_feed"}]}]}
276
+ elif platform.upper()=="FACEBOOK":
277
+ if "comment_type"=="comment":
278
+ body = {"object": "page", "entry": [{"id": page_id, "time": stamp, "changes": [{"field": "feed", "value": {
279
+ "from": {"id": user_id, "name": name},
280
+ "post": {"status_type": "added_video", "is_published": True, "updated_time": "2022-11-18T09:57:26+0000",
281
+ "permalink_url": "https://www.facebook.com/permalink.php?story_fbid=pfbid02jLK3e6YdFSXp2DmD7j7vtStLXoBzTi8rxKrp6jFhVMUTTEgz6qvZA8soR9Uwydd8l&id=107977035056574",
282
+ "promotion_status": "inactive", "id": post_id}, "message": keyword, "item": "comment",
283
+ "verb": "add", "post_id": post_id, "comment_id": comment_id,
284
+ "created_time": stamp, "parent_id": post_id}}]}]}
285
+ elif "comment_type"=="like":
286
+ body = {"entry": [{"id": page_id, "time": stamp, "changes": [{"value": {"from": {"id": user_id, "name": name}, "post_id": post_id, "created_time": stamp, "item": "reaction", "parent_id": post_id, "reaction_type": "like", "verb": "add"}, "field": "feed"}]}], "object": "page"}
287
+
275
288
  # print(body)
276
289
  url = "%s/facebook/webhook" % env
277
290
  sign_text = hmac.new(key.encode("utf-8"), json.dumps(body).encode("utf-8"), sha1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.9.9
3
+ Version: 3.0.0
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='2.9.9',
5
+ version='3.0.0',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),