sc-common-interface 2.8.7__tar.gz → 2.8.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc_common_interface
3
- Version: 2.8.7
3
+ Version: 2.8.9
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -238,10 +238,9 @@ def get_str_time(time_type="add",unit="days",num=1,format='%Y-%m-%dT%H:%M:%S.%f'
238
238
 
239
239
 
240
240
 
241
-
242
241
  if __name__=="__main__":
243
- format_time = get_str_time(num=2,time_type="sub")
244
- print(format_time)
242
+ pass
243
+
245
244
 
246
245
 
247
246
 
@@ -8,7 +8,7 @@ import random
8
8
  import hmac
9
9
  from hashlib import sha1
10
10
  import random
11
- from datetime import datetime
11
+ from datetime import *
12
12
 
13
13
  def delete_post(data):
14
14
  env = data["env"]
@@ -167,6 +167,7 @@ def delate_activity(data):
167
167
  headers = data["headers"]
168
168
  activity_id = data["activity_id"]
169
169
  url = "%s/api/activity/%s" % (env, activity_id)
170
+ time.sleep(5)
170
171
  response = requests.delete(url,headers=headers).json()
171
172
  return response
172
173
 
@@ -531,7 +532,7 @@ def get_broadcast_list(data):
531
532
  pageNum = 1
532
533
  pageSize = 12
533
534
  pageNum =data.get("pageNum",pageNum)
534
- pageNum = data.get("pageSize", pageSize)
535
+ pageSize = data.get("pageSize", pageSize)
535
536
  name = data.get("name",name)
536
537
  if "name" in data:
537
538
  name= data["name"]
@@ -544,6 +545,7 @@ def get_broadcast_list(data):
544
545
  "pageNum": pageNum,
545
546
  "pageSize": pageSize
546
547
  }
548
+ # print(body)
547
549
  reponse = requests.post(url,headers=headers,json=body).json()
548
550
  if name !="":
549
551
  name_list = jsonpath(reponse,"$..name")
@@ -948,7 +950,7 @@ def get_stamp_time(data):
948
950
  now = datetime.now()
949
951
  if time_type not in {"add", "sub"}:
950
952
  raise ValueError("Invalid time_type. Use 'add' or 'sub'.")
951
- stamp_time = now + datetime.timedelta(**{unit:num if time_type == "add" else -num})
953
+ stamp_time = now + timedelta(**{unit:num if time_type == "add" else -num})
952
954
  return int(stamp_time.timestamp()*1000)
953
955
 
954
956
  def get_line_info(data):
@@ -2452,14 +2454,10 @@ def get_merchant_currency(data):
2452
2454
 
2453
2455
 
2454
2456
  if __name__=="__main__":
2455
- from PostCommonInterface import *
2456
-
2457
- data = {'env': 'https://front-admin-preview.shoplineapp.com', 'headers': {'Content-Type': 'application/json',
2458
- 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I',
2459
- 'lang': 'en'}, 'sales_id': '552980'
2460
- }
2461
- __, response = get_comment_user(data)
2462
- print(response)
2457
+ stamp1 = get_stamp_time({"num":5040})
2458
+ print(stamp1)
2459
+ stamp2 = get_stamp_time({"num": 5041})
2460
+ print(stamp2)
2463
2461
 
2464
2462
 
2465
2463
 
@@ -1068,6 +1068,7 @@ def get_user_conversation_id(data):
1068
1068
  # param = {"type":"facebook","user_id":vars["user_id"],"party_channel_id":vars["platform_channel_id"]}
1069
1069
  print(url)
1070
1070
  response = requests.get(url, headers=headers).json()
1071
+ print(response)
1071
1072
 
1072
1073
  conversation_id = jsonpath(response, "$.data.id")[0]
1073
1074
  return conversation_id,response
@@ -1721,8 +1722,5 @@ def edit_message(data):
1721
1722
 
1722
1723
 
1723
1724
  if __name__=="__main__":
1724
- data = {'env': 'https://front-admin-preview.shoplineapp.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I', 'lang': 'en'}, 'sales_id': 553386, 'platform': 'FACEBOOK', 'prize_type': 'product', 'key': '5e3bba98882fc0fb22a0607238bc5b8f', 'type': 'activity'}
1725
- orderNumber, customer_id, res = manual_order(data)
1726
- print(orderNumber)
1727
-
1725
+ pass
1728
1726
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.8.7
3
+ Version: 2.8.9
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='sc_common_interface',
5
- version='2.8.7',
5
+ version='2.8.9',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),