sc-common-interface 2.2.3__tar.gz → 2.2.4__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-2.2.3 → sc-common-interface-2.2.4}/PKG-INFO +1 -1
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface/PostCommonInterface.py +36 -41
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/setup.py +1 -1
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/setup.cfg +0 -0
{sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -792,35 +792,35 @@ def merge_customer(data):
|
|
|
792
792
|
user_id = data["user_id"]
|
|
793
793
|
page_id = data["page_id"]
|
|
794
794
|
platform = data["platform"]
|
|
795
|
+
customer_id = jsonpath(response,"$..customer_id")[0]
|
|
795
796
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
body = {"email": "", "mobile_phone": phone, "mobile_phone_country_calling_code": "86",
|
|
802
|
-
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
803
|
-
"id": None, "party_channel_id": page_id, "platform": platform, "is_member": True}
|
|
804
|
-
if items != []:
|
|
805
|
-
id = jsonpath(response, "$..id")[0]
|
|
806
|
-
customer_id = id
|
|
797
|
+
if customer_id==None:
|
|
798
|
+
response = search_customer(data)
|
|
799
|
+
items = response["data"]["items"]
|
|
800
|
+
# 创建会员
|
|
801
|
+
url = "%s/uc/customers/merge" % env
|
|
807
802
|
body = {"email": "", "mobile_phone": phone, "mobile_phone_country_calling_code": "86",
|
|
808
803
|
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
809
|
-
"id":
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
email = "%d@qq.com"%int(time.time())
|
|
817
|
-
body = {"email": email, "mobile_phone": "", "mobile_phone_country_calling_code": "86",
|
|
818
|
-
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
819
|
-
"id": "", "party_channel_id": page_id, "platform": platform, "is_member": False}
|
|
804
|
+
"id": None, "party_channel_id": page_id, "platform": platform, "is_member": True}
|
|
805
|
+
if items != []:
|
|
806
|
+
id = jsonpath(response, "$..id")[0]
|
|
807
|
+
customer_id = id
|
|
808
|
+
body = {"email": "", "mobile_phone": phone, "mobile_phone_country_calling_code": "86",
|
|
809
|
+
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
810
|
+
"id": id, "party_channel_id": page_id, "platform": platform, "is_member": True}
|
|
820
811
|
response = requests.put(url, headers=headers, json=body)
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
812
|
+
print("合并会员返回",response.json())
|
|
813
|
+
# print("创建会员请求体",body)
|
|
814
|
+
if response.raise_for_status():
|
|
815
|
+
customer_id = response.json()["data"]["id"]
|
|
816
|
+
elif response.json()["code"]=="UC0409":
|
|
817
|
+
email = "%d@qq.com"%int(time.time())
|
|
818
|
+
body = {"email": email, "mobile_phone": "", "mobile_phone_country_calling_code": "86",
|
|
819
|
+
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
820
|
+
"id": "", "party_channel_id": page_id, "platform": platform, "is_member": False}
|
|
821
|
+
response = requests.put(url, headers=headers, json=body)
|
|
822
|
+
else:
|
|
823
|
+
customer_id = response.json()["data"]["id"]
|
|
824
824
|
return response,customer_id
|
|
825
825
|
|
|
826
826
|
|
|
@@ -851,8 +851,8 @@ def manual_order(data):
|
|
|
851
851
|
# 先查询号码或邮箱是否被占有
|
|
852
852
|
#创建会员
|
|
853
853
|
response,customer_id = merge_customer(data)
|
|
854
|
-
print("会员ID",customer_id)
|
|
855
|
-
print("创建会员返回,",response.text)
|
|
854
|
+
# print("会员ID",customer_id)
|
|
855
|
+
# print("创建会员返回,",response.text)
|
|
856
856
|
#给会员新增物流地址
|
|
857
857
|
url = "%s/uc/customers/%s" % (env,customer_id)
|
|
858
858
|
postcode = "76653"
|
|
@@ -1436,11 +1436,13 @@ def set_delivery(data):
|
|
|
1436
1436
|
response = requests.put(url, headers=headers, json=body).json()
|
|
1437
1437
|
return response
|
|
1438
1438
|
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1439
|
+
def get_mc_order_link(url):
|
|
1440
|
+
response = requests.get(url)
|
|
1441
|
+
print(response.headers)
|
|
1442
|
+
location = response.headers.get("Location")
|
|
1443
|
+
# print(location)
|
|
1444
|
+
key = location.split("/")[-1].split("?")[0]
|
|
1445
|
+
return key
|
|
1444
1446
|
|
|
1445
1447
|
|
|
1446
1448
|
|
|
@@ -1448,13 +1450,6 @@ def set_delivery(data):
|
|
|
1448
1450
|
|
|
1449
1451
|
|
|
1450
1452
|
if __name__=="__main__":
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
match = re.search(r"/orders/([^/?]+)", url)
|
|
1454
|
-
if match:
|
|
1455
|
-
order_id = match.group(1)
|
|
1456
|
-
print(order_id)
|
|
1457
|
-
else:
|
|
1458
|
-
print("未找到订单 ID")
|
|
1453
|
+
data = {'env': 'https://front-admin-preview.shoplineapp.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhMjQ0ZTUwMmMyYzIwY2E5MWVhZDg0NWQ2YTk4YzVlNCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVmNTlmMTI4MzcyZWIzMDAwNmRjNDcwMSJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.8m_bKPfZJxan6M6hv_4byPROt_UtvHqnyWAT9Ox1CO0', 'lang': 'en'}, 'platform': 'INSTAGRAM', 'patternModel': 'INCLUDE_MATCH', 'sales_id': 423810, 'since': '1685030400', 'user_id': '4255666934537806', 'key': '5e3bba98882fc0fb22a0607238bc5b8f', 'keyword': '无规格商品关键字'}
|
|
1454
|
+
response = manual_order(data)
|
|
1459
1455
|
|
|
1460
|
-
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.2.3 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|