sc-common-interface 3.2.5__tar.gz → 3.2.7__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 (18) hide show
  1. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/PKG-INFO +1 -1
  2. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/LiveCommonInterface.py +8 -3
  3. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/PostCommonInterface.py +1 -1
  4. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface.egg-info/PKG-INFO +1 -1
  5. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/setup.py +1 -1
  6. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/CommonOa.py +0 -0
  7. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/McCommonInterface.py +0 -0
  8. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/OperaMysql.py +0 -0
  9. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/OperaRedis.py +0 -0
  10. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/ScPulsar.py +0 -0
  11. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/ScWebsocket.py +0 -0
  12. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/__init__.py +0 -0
  13. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface/pra.py +0 -0
  14. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface.egg-info/SOURCES.txt +0 -0
  15. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface.egg-info/dependency_links.txt +0 -0
  16. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface.egg-info/requires.txt +0 -0
  17. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/sc_common_interface.egg-info/top_level.txt +0 -0
  18. {sc_common_interface-3.2.5 → sc_common_interface-3.2.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sc_common_interface
3
- Version: 3.2.5
3
+ Version: 3.2.7
4
4
  Summary: SC贴文销售公用的接口
5
5
  Author: river
6
6
  Requires-Dist: requests>=2.0.0
@@ -413,7 +413,7 @@ def get_live_info(data):
413
413
  sales_type = "live"
414
414
  if "sales_type" in data:
415
415
  sales_type = data["sales_type"]
416
- url = "%s/api/posts/%s/sales/%s" % (env, sales_type.lower(), sales_id)
416
+ url = "%s/admin/api/bff-web/%s/sales/%s" % (env, sales_type.lower(), sales_id)
417
417
  count = 0
418
418
  while True:
419
419
  response = requests.get(url, headers=headers)
@@ -2254,7 +2254,11 @@ def delete_auto_reply(data):
2254
2254
  def handler_auto_reply(data):
2255
2255
  """处理自动回复,避免超过10个,超过10个无法新增"""
2256
2256
  live_info = get_live_info(data)
2257
- autoReplyCommentConfig = live_info["data"]["autoReplyCommentConfig"]["rules"]
2257
+ print(live_info)
2258
+ try:
2259
+ autoReplyCommentConfig = live_info["data"]["auto_reply_comment_config"]["rules"]
2260
+ except Exception:
2261
+ autoReplyCommentConfig = live_info["data"]["autoReplyCommentConfig"]["rules"]
2258
2262
  num = data.get("num", 8)
2259
2263
  if len(autoReplyCommentConfig) > num:
2260
2264
  for info in autoReplyCommentConfig:
@@ -2776,7 +2780,8 @@ def get_live_global(data):
2776
2780
 
2777
2781
 
2778
2782
  if __name__ == "__main__":
2779
- data = {'object': 'page', 'entry': [{'time': 1790067214820, 'id': '102079935646743', 'messaging': [{'sender': {'id': '4624646680906316'}, 'recipient': {'id': '102079935646743'}, 'timestamp': 1790067214820, 'postback': {'title': 'continue--1790067214', 'payload': '{"postCheckoutCartLink":"","postId":"102079935646743_1456428393206933","salesId":"725225","type":"post_continue"}', 'mid': 'm_w6KNGd0PMndK0LvCw7Hzy1zsVSWT0fpN3ievQ9LtB0NxnnTQGDMyKI5DFeVbaJIRni1cqqJYXIJ-wq98aw1790067214820'}}]}]}
2783
+ data = {'env': 'https://front-service.shoplinestg.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIwNWM4NzQ5NjViZmU0N2QzMTIyZTY2NTZkZjIyYTRjOCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MjI5YTdiYWVhNzA2NDJhOGI2NWViZGEiLCJhcHBsaWNhdGlvbl9pZCI6IjYwZWVjNWViZjhkYzkyMDAwNjUyZTAwNiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMteXkuc2hvcGxpbmVzdGcuY29tIiwiYXVkIjpbXSwic3ViIjoiNjIyOWE3YmFlYTcwNjQyYThiNjVlYmRhIn0.fZ3Fm8KQDa4lklKbwt_5KzjDp1rIXLx3wHGHvWfYMno', 'lang': 'en'}, 'sales_id': '130726', 'sales_type': 'post'}
2784
+ handler_auto_reply(data)
2780
2785
 
2781
2786
 
2782
2787
 
@@ -1078,7 +1078,7 @@ def get_user_conversation_id(data):
1078
1078
  platform = "facebook"
1079
1079
  if "platform" in data:
1080
1080
  platform = data["platform"].lower()
1081
- url = "%s/mc/conversation/id?type=%s&user_id=%s&party_channel_id=%s" % (env, platform, user_id, page_id)
1081
+ url = "%s/admin/api/bff-web/mc/conversation/id?type=%s&user_id=%s&party_channel_id=%s" % (env, platform, user_id, page_id)
1082
1082
  # param = {"type":"facebook","user_id":vars["user_id"],"party_channel_id":vars["platform_channel_id"]}
1083
1083
  print(url)
1084
1084
  response = requests.get(url, headers=headers).json()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sc_common_interface
3
- Version: 3.2.5
3
+ Version: 3.2.7
4
4
  Summary: SC贴文销售公用的接口
5
5
  Author: river
6
6
  Requires-Dist: requests>=2.0.0
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='sc_common_interface',
5
- version='3.2.5',
5
+ version='3.2.7',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),