sc-common-interface 3.0.1__tar.gz → 3.0.3__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.3}/PKG-INFO +1 -1
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/LiveCommonInterface.py +22 -30
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/setup.py +1 -1
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/CommonOa.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/OperaMysql.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/OperaRedis.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/ScPulsar.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/ScWebsocket.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/setup.cfg +0 -0
{sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/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
|
|
@@ -1763,7 +1770,10 @@ def get_sales_keyword(data):
|
|
|
1763
1770
|
|
|
1764
1771
|
|
|
1765
1772
|
def get_stock_product_set(res, type="stock"):
|
|
1766
|
-
"""直播间查询OA组合商品信息
|
|
1773
|
+
"""直播间查询OA组合商品信息
|
|
1774
|
+
stock:查询有库存
|
|
1775
|
+
out:查询无库存
|
|
1776
|
+
"""
|
|
1767
1777
|
list_data = res["data"]["list"]
|
|
1768
1778
|
if type == "stock":
|
|
1769
1779
|
for i in list_data:
|
|
@@ -1776,7 +1786,7 @@ def get_stock_product_set(res, type="stock"):
|
|
|
1776
1786
|
if quantity == -1:
|
|
1777
1787
|
# print("库存无限数量")
|
|
1778
1788
|
pass
|
|
1779
|
-
elif quantity
|
|
1789
|
+
elif quantity < count:
|
|
1780
1790
|
break
|
|
1781
1791
|
keyword = combination["keywords"][0]
|
|
1782
1792
|
product_id = i["id"]
|
|
@@ -2535,27 +2545,9 @@ def send_comment():
|
|
|
2535
2545
|
contentbody = json.dumps(contentbody)
|
|
2536
2546
|
headers = {"Content-Type": "application/json", "x-hub-signature": "sha1=%s" % signdata}
|
|
2537
2547
|
res = requests.post(url, headers=headers, data=contentbody)
|
|
2538
|
-
print(res.content)
|
|
2548
|
+
# print(res.content)
|
|
2539
2549
|
|
|
2540
2550
|
|
|
2541
2551
|
if __name__ == "__main__":
|
|
2542
|
-
|
|
2543
|
-
|
|
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)
|
|
2552
|
+
pass
|
|
2553
|
+
|
|
File without changes
|
{sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/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.3}/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.3}/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.3}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-3.0.1 → sc_common_interface-3.0.3}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|