sc-common-interface 3.0.7__tar.gz → 3.0.9__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.7 → sc_common_interface-3.0.9}/PKG-INFO +1 -1
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/CommonOa.py +3 -1
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/LiveCommonInterface.py +59 -7
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/PostCommonInterface.py +21 -7
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/setup.py +1 -1
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/OperaMysql.py +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/OperaRedis.py +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/ScPulsar.py +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/ScWebsocket.py +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/setup.cfg +0 -0
|
@@ -243,7 +243,9 @@ def get_str_time(time_type="add",unit="days",num=1,format='%Y-%m-%dT%H:%M:%S.%f'
|
|
|
243
243
|
|
|
244
244
|
|
|
245
245
|
if __name__=="__main__":
|
|
246
|
-
|
|
246
|
+
data = {'oa_env': 'https://open-preview.shopline.io', 'oa_headers': {'Authorization': 'Bearar e2a8ce0b65ed2a79c702949066ce7ea3d07af192c6dc506a824bac8e8892340c', 'Content-Type': 'application/json'}, 'product_id': '68cea74d77432c000e3a374b', 'hide_price': True}
|
|
247
|
+
res = edit_product_spu(data)
|
|
248
|
+
print(res)
|
|
247
249
|
|
|
248
250
|
|
|
249
251
|
|
{sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -164,6 +164,7 @@ def create_activity(data):
|
|
|
164
164
|
|
|
165
165
|
|
|
166
166
|
def delate_activity(data):
|
|
167
|
+
#写错名,但很多方法用了,懒得改了
|
|
167
168
|
env = data["env"]
|
|
168
169
|
headers = data["headers"]
|
|
169
170
|
activity_id = data["activity_id"]
|
|
@@ -173,6 +174,15 @@ def delate_activity(data):
|
|
|
173
174
|
response = requests.delete(url, headers=headers,json=body).json()
|
|
174
175
|
return response
|
|
175
176
|
|
|
177
|
+
def delete_activity(data):
|
|
178
|
+
env = data["env"]
|
|
179
|
+
headers = data["headers"]
|
|
180
|
+
activity_id = data["activity_id"]
|
|
181
|
+
url = "%s/admin/api/bff-web/live/activity/%s" % (env, activity_id)
|
|
182
|
+
body = {}
|
|
183
|
+
time.sleep(1)
|
|
184
|
+
response = requests.delete(url, headers=headers,json=body).json()
|
|
185
|
+
return response
|
|
176
186
|
|
|
177
187
|
def start_activity(data):
|
|
178
188
|
env = data["env"]
|
|
@@ -376,11 +386,15 @@ def send_sl_comment(data):
|
|
|
376
386
|
headers = data["headers"]
|
|
377
387
|
sales_id = data["sales_id"]
|
|
378
388
|
url = "%s/api/posts/live/viewer/%s/send/comments" % (env, sales_id)
|
|
389
|
+
login_url = "%s/api/posts/live/viewer/unauthorized/post/sales/%s/user/info?appId=SL101-web" % (env, sales_id)
|
|
379
390
|
content = data.get("content", "sl留言")
|
|
380
391
|
headers["content-type"] = "application/json"
|
|
381
392
|
body = {
|
|
382
393
|
"content": content
|
|
383
394
|
}
|
|
395
|
+
#先进入直播间再留言
|
|
396
|
+
login_response = requests.get(login_url,headers=headers).json()
|
|
397
|
+
print("login_response:",login_response)
|
|
384
398
|
response = requests.post(url, headers=headers, json=body).json()
|
|
385
399
|
if response["code"] == "SUCCESS":
|
|
386
400
|
comment_id = response["data"]["comment_id"]
|
|
@@ -706,7 +720,7 @@ def create_live(data):
|
|
|
706
720
|
"salesOwner": salesOwner,
|
|
707
721
|
"salesDescription": salesDescription,
|
|
708
722
|
"platforms": [
|
|
709
|
-
platform
|
|
723
|
+
platform.upper()
|
|
710
724
|
],
|
|
711
725
|
"platformChannels": [],
|
|
712
726
|
"startTime": startTime,
|
|
@@ -2517,13 +2531,13 @@ def send_comment():
|
|
|
2517
2531
|
|
|
2518
2532
|
# message = "fb文3本消息%d"%timStamp
|
|
2519
2533
|
# message = "%d" % random.randint(3, 999)
|
|
2520
|
-
message = "
|
|
2534
|
+
message = "哦哦哦哦订单"
|
|
2521
2535
|
|
|
2522
2536
|
# 生产
|
|
2523
|
-
key = 'a2f4cae7b637eb42967ef5ab6a6a3ff7'
|
|
2524
|
-
url = 'https://front-admin.shoplineapp.com/facebook/webhook'
|
|
2525
|
-
post_id = "
|
|
2526
|
-
page_id = "107977035056574"
|
|
2537
|
+
# key = 'a2f4cae7b637eb42967ef5ab6a6a3ff7'
|
|
2538
|
+
# url = 'https://front-admin.shoplineapp.com/facebook/webhook'
|
|
2539
|
+
# post_id = "119305964434044_1453999779043575"
|
|
2540
|
+
# page_id = "107977035056574"
|
|
2527
2541
|
|
|
2528
2542
|
#预发
|
|
2529
2543
|
# key = '5e3bba98882fc0fb22a0607238bc5b8f'
|
|
@@ -2531,6 +2545,12 @@ def send_comment():
|
|
|
2531
2545
|
# post_id = "106411048594439_1764064707792500"
|
|
2532
2546
|
# page_id = "106411048594439"
|
|
2533
2547
|
|
|
2548
|
+
#test
|
|
2549
|
+
key = '4f6b54deff90cdc9966cbe7b82731b3b'
|
|
2550
|
+
url = 'https://front-service.shoplinestg.com/facebook/webhook'
|
|
2551
|
+
post_id = "119305964434044_1453999779043575"
|
|
2552
|
+
page_id = "119305964434044"
|
|
2553
|
+
|
|
2534
2554
|
randnum = random.randint(1, 1000)
|
|
2535
2555
|
user_id = "4724508317%d%d" % (timStamp, randnum)
|
|
2536
2556
|
# user_id = "47245083171744792310"0
|
|
@@ -2646,6 +2666,7 @@ def get_bulk_edit_keyword(data):
|
|
|
2646
2666
|
return bulk_edit_body
|
|
2647
2667
|
|
|
2648
2668
|
def syn_line_product(data):
|
|
2669
|
+
"INTRODUCING,HIDDEN、DISPLAYING"
|
|
2649
2670
|
env = data["env"]
|
|
2650
2671
|
headers = data["headers"]
|
|
2651
2672
|
sales_id = data["sales_id"]
|
|
@@ -2679,6 +2700,34 @@ def get_live_comment(data):
|
|
|
2679
2700
|
response = requests.get(url,headers=headers).json()
|
|
2680
2701
|
return response["data"]["list"]
|
|
2681
2702
|
|
|
2703
|
+
def line_bind_webhook(data):
|
|
2704
|
+
env = data["env"]
|
|
2705
|
+
url = "%s/dc/webhook/line/user/bind"%env
|
|
2706
|
+
line_user_info = data["line_user_info"]
|
|
2707
|
+
merchant_id = line_user_info["merchant_id"]
|
|
2708
|
+
ecid = line_user_info["ecid"]
|
|
2709
|
+
line_user_id = line_user_info["line_user_id"]
|
|
2710
|
+
ec_user_id = line_user_info["ec_user_id"]
|
|
2711
|
+
sales_id = line_user_info["sales_id"]
|
|
2712
|
+
body = {
|
|
2713
|
+
"event": "Customer",
|
|
2714
|
+
"merchant_id": merchant_id,
|
|
2715
|
+
"topic": "customer/bind_line_live_user",
|
|
2716
|
+
"trace_id": "a2af56da-6218-4bf2-b825-8fcfd212e0be",
|
|
2717
|
+
"ts": "1731232573927498500",
|
|
2718
|
+
"resource": {
|
|
2719
|
+
"ecid": ecid,
|
|
2720
|
+
"line_user_id": line_user_id,
|
|
2721
|
+
"ec_user_id": ec_user_id,
|
|
2722
|
+
"live_event_id": sales_id,
|
|
2723
|
+
"sale_event_id": sales_id
|
|
2724
|
+
},
|
|
2725
|
+
"retry_count": 0
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
response = requests.post(url,json=body,headers={"Content-Type":"application/json"})
|
|
2729
|
+
|
|
2730
|
+
|
|
2682
2731
|
|
|
2683
2732
|
|
|
2684
2733
|
|
|
@@ -2687,7 +2736,10 @@ def get_live_comment(data):
|
|
|
2687
2736
|
|
|
2688
2737
|
|
|
2689
2738
|
if __name__ == "__main__":
|
|
2690
|
-
|
|
2739
|
+
for i in range(100):
|
|
2740
|
+
time.sleep(0.5)
|
|
2741
|
+
send_comment()
|
|
2742
|
+
|
|
2691
2743
|
|
|
2692
2744
|
|
|
2693
2745
|
|
{sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -823,8 +823,9 @@ def get_payment(data):
|
|
|
823
823
|
:return:默认返回第一个支付方式
|
|
824
824
|
"""
|
|
825
825
|
env = data["env"]
|
|
826
|
+
oc_env = data["oc_env"]
|
|
826
827
|
headers = data["headers"]
|
|
827
|
-
url ="%s/openApi/proxy/v1/payments?page=1&per_page=10&include_fields[]=config_data.tappay"%
|
|
828
|
+
url ="%s/openApi/proxy/v1/payments?page=1&per_page=10&include_fields[]=config_data.tappay"%oc_env
|
|
828
829
|
response = requests.get(url, headers=headers).json()
|
|
829
830
|
payment_types = [item["type"] for item in response["data"]["items"]]
|
|
830
831
|
payment_id = ""
|
|
@@ -847,8 +848,9 @@ def get_delivery(data):
|
|
|
847
848
|
"""
|
|
848
849
|
# print("物流data",data)
|
|
849
850
|
env = data["env"]
|
|
851
|
+
oc_env = data["oc_env"]
|
|
850
852
|
headers = data["headers"]
|
|
851
|
-
url = "%s/openApi/proxy/v1/delivery_options?page=1&per_page=998"%
|
|
853
|
+
url = "%s/openApi/proxy/v1/delivery_options?page=1&per_page=998"%oc_env
|
|
852
854
|
response = requests.get(url, headers=headers).json()
|
|
853
855
|
# print(response)
|
|
854
856
|
delivery_types = [item["region_type"] for item in response["data"]["items"]]
|
|
@@ -966,7 +968,20 @@ def manual_order(data):
|
|
|
966
968
|
:param data:
|
|
967
969
|
:return:
|
|
968
970
|
"""
|
|
971
|
+
oc_env_stg = "https://create-order.shoplinestg.com"
|
|
972
|
+
oc_env_pre = "https://create-order-preview.shoplineapp.com"
|
|
973
|
+
oc_env_pro = "https://create-order.shoplineapp.com"
|
|
974
|
+
river_env_tag = data["river_env_tag"]
|
|
975
|
+
if river_env_tag=="test":
|
|
976
|
+
oc_env = oc_env_stg
|
|
977
|
+
elif river_env_tag=="pre":
|
|
978
|
+
oc_env = oc_env_pre
|
|
979
|
+
elif river_env_tag=="pro":
|
|
980
|
+
oc_env = oc_env_pro
|
|
981
|
+
else:
|
|
982
|
+
oc_env = oc_env_pre
|
|
969
983
|
env = data["env"]
|
|
984
|
+
data["oc_env"] = oc_env
|
|
970
985
|
headers = data["headers"]
|
|
971
986
|
phone = "18776343453"
|
|
972
987
|
phone = data.get("phone",phone)
|
|
@@ -988,7 +1003,7 @@ def manual_order(data):
|
|
|
988
1003
|
# print("会员ID",customer_id)
|
|
989
1004
|
# print("创建会员返回,",response.text)
|
|
990
1005
|
#给会员新增物流地址
|
|
991
|
-
url = "%s/uc/customers/%s" % (
|
|
1006
|
+
url = "%s/uc/customers/%s" % (oc_env,customer_id)
|
|
992
1007
|
postcode = "76653"
|
|
993
1008
|
delivery_data = {"delivery_addresses": [
|
|
994
1009
|
{"city": "bb", "country": "CN", "postcode": postcode, "recipient_name": name,
|
|
@@ -1011,7 +1026,7 @@ def manual_order(data):
|
|
|
1011
1026
|
|
|
1012
1027
|
# 给cart 设置物流 和设置支付方式
|
|
1013
1028
|
url = "%s/openApi/proxy/v1/internal/mc/api/carts/%s?owner_type=User&cart_uid=%s&created_by=post&skip_reapply_promotion=false&shop_session_id=%s" % (
|
|
1014
|
-
|
|
1029
|
+
oc_env,customer_id, customer_id, user_id)
|
|
1015
1030
|
delivery_id,__ = get_delivery(data)
|
|
1016
1031
|
payment_id,__ = get_payment(data)
|
|
1017
1032
|
body = {"delivery_option_id": delivery_id, "country": "CN", "countryCode": "CN",
|
|
@@ -1019,7 +1034,7 @@ def manual_order(data):
|
|
|
1019
1034
|
res = requests.put(url, headers=headers, json = body).json()
|
|
1020
1035
|
# print("设置cart",res)
|
|
1021
1036
|
# 成立订单
|
|
1022
|
-
url = "%s/manual_order/checkout"%
|
|
1037
|
+
url = "%s/manual_order/checkout"%oc_env
|
|
1023
1038
|
delivery_address = delivery_data["delivery_addresses"][0]
|
|
1024
1039
|
delivery_address["district"] = None
|
|
1025
1040
|
delivery_address["key"] = None
|
|
@@ -1715,5 +1730,4 @@ def edit_message(data):
|
|
|
1715
1730
|
|
|
1716
1731
|
|
|
1717
1732
|
if __name__=="__main__":
|
|
1718
|
-
|
|
1719
|
-
|
|
1733
|
+
pass
|
{sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-3.0.7 → sc_common_interface-3.0.9}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|