sc-common-interface 2.2.4__tar.gz → 2.2.6__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.4 → sc-common-interface-2.2.6}/PKG-INFO +1 -1
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface/PostCommonInterface.py +42 -25
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/setup.py +1 -1
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/setup.cfg +0 -0
{sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -177,6 +177,9 @@ def search_oa_product(data):
|
|
|
177
177
|
env = data["env"]
|
|
178
178
|
headers = data["headers"]
|
|
179
179
|
url = "%s/openApi/proxy/v1/products?page=1&per_page=4" %env
|
|
180
|
+
if "query" in data:
|
|
181
|
+
query = data["query"]
|
|
182
|
+
url = "%s/openApi/proxy/v1/products?page=1&per_page=4&query=%s" % (env,query)
|
|
180
183
|
response = requests.get(url, headers=headers).json()
|
|
181
184
|
return response
|
|
182
185
|
|
|
@@ -350,9 +353,6 @@ def get_page_post(data):
|
|
|
350
353
|
:return:响应
|
|
351
354
|
"""
|
|
352
355
|
#时间戳转换
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
356
|
env = data["env"]
|
|
357
357
|
headers = data["headers"]
|
|
358
358
|
platform = "FACEBOOK"
|
|
@@ -400,28 +400,40 @@ def relate_post(data):
|
|
|
400
400
|
sales_id = data["sales_id"]
|
|
401
401
|
if "platform" in data:
|
|
402
402
|
platform = data["platform"].upper()
|
|
403
|
-
response = get_page_post(data)
|
|
404
|
-
available_post_list = []
|
|
405
|
-
related_sales = jsonpath(response,"$..related_sales")
|
|
406
|
-
print("查询到的贴文信息",related_sales)
|
|
407
|
-
for index,value in enumerate(related_sales):
|
|
408
|
-
if value==False:
|
|
409
|
-
available_post_list.append(response["data"]["data"][index])
|
|
410
403
|
url = "%s/api/posts/post/sales/%s/addPost"%(env,sales_id)
|
|
404
|
+
body = {}
|
|
405
|
+
if platform=="FB_GROUP":
|
|
406
|
+
page_id = data["page_id"]
|
|
407
|
+
relationUrl = data["relationUrl"]
|
|
408
|
+
body = {
|
|
409
|
+
"pageId": page_id,
|
|
410
|
+
"platform": "FB_GROUP",
|
|
411
|
+
"relationUrl": relationUrl
|
|
412
|
+
}
|
|
413
|
+
else:
|
|
414
|
+
response = get_page_post(data)
|
|
415
|
+
available_post_list = []
|
|
416
|
+
related_sales = jsonpath(response,"$..related_sales")
|
|
417
|
+
print("查询到的贴文信息",related_sales)
|
|
418
|
+
for index,value in enumerate(related_sales):
|
|
419
|
+
if value==False:
|
|
420
|
+
available_post_list.append(response["data"]["data"][index])
|
|
421
|
+
|
|
411
422
|
# platform = "FACEBOOK"
|
|
412
423
|
# print(available_post_list[0])
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
424
|
+
page_id = jsonpath(available_post_list[0],"$..from.id")[0]
|
|
425
|
+
page_name = jsonpath(available_post_list[0],"$..from.name")[0]
|
|
426
|
+
post_id = jsonpath(available_post_list[0],"$.id")[0]
|
|
427
|
+
message = jsonpath(available_post_list[0],"$.message")[0]
|
|
428
|
+
permalink_url = jsonpath(available_post_list[0],"$.permalink_url")[0]
|
|
429
|
+
status_type = jsonpath(available_post_list[0],"$.status_type")[0]
|
|
430
|
+
picture = jsonpath(available_post_list[0],"$.picture")[0]
|
|
431
|
+
body = {"pageId": page_id, "pageName": page_name, "platform": platform,
|
|
432
|
+
"postList": [{"postId": post_id, "postTitle": page_name,
|
|
433
|
+
"postDescription": message, "postImageUrl": picture,
|
|
434
|
+
"permalinkUrl": permalink_url,
|
|
435
|
+
"statusType": status_type}]}
|
|
436
|
+
|
|
425
437
|
response = requests.post(url,headers=headers,json=body).json()
|
|
426
438
|
return response
|
|
427
439
|
|
|
@@ -1450,6 +1462,11 @@ def get_mc_order_link(url):
|
|
|
1450
1462
|
|
|
1451
1463
|
|
|
1452
1464
|
if __name__=="__main__":
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1465
|
+
pass
|
|
1466
|
+
# headers = {"content-type": "application/json",
|
|
1467
|
+
# "authorization": "Bearer 11eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIzN2Y2MjY2M2IyMTI1MjIzMWZlMTc4MTE2ODhkNDliYSIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MjI5YTdiYWVhNzA2NDJhOGI2NWViZGEiLCJhcHBsaWNhdGlvbl9pZCI6IjYwZWVjNWViZjhkYzkyMDAwNjUyZTAwNiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMteXkuc2hvcGxpbmVzdGcuY29tIiwiYXVkIjpbXSwic3ViIjoiNjIyOWE3YmFlYTcwNjQyYThiNjVlYmRhIn0.FwtntG1dAYWNUcEZf6WSehXQveEw_rvTSGPEM3xV9FA"}
|
|
1468
|
+
# data = {"env": "https://front-service.shoplinestg.com", "headers": headers, "platform": "FB_GROUP",
|
|
1469
|
+
# "sales_id": "84031", "page_id": "110842575060695",
|
|
1470
|
+
# "relationUrl": "https://www.facebook.com/groups/416632743936652/posts/823646243235298/"}
|
|
1471
|
+
# res = relate_post(data)
|
|
1472
|
+
# print(res)
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.2.4 → sc-common-interface-2.2.6}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|