sc-common-interface 2.8.8__tar.gz → 2.9.0__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.8
3
+ Version: 2.9.0
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
+
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
 
@@ -544,7 +545,7 @@ def get_broadcast_list(data):
544
545
  "pageNum": pageNum,
545
546
  "pageSize": pageSize
546
547
  }
547
- print(body)
548
+ # print(body)
548
549
  reponse = requests.post(url,headers=headers,json=body).json()
549
550
  if name !="":
550
551
  name_list = jsonpath(reponse,"$..name")
@@ -946,12 +947,13 @@ def get_stamp_time(data):
946
947
  time_type = data.get("time_type","add")
947
948
  unit = data.get("unit","minutes")
948
949
  # 获取当前 UTC 时间
949
- now = datetime.now()
950
+ now = datetime.datetime.now()
950
951
  if time_type not in {"add", "sub"}:
951
952
  raise ValueError("Invalid time_type. Use 'add' or 'sub'.")
952
953
  stamp_time = now + datetime.timedelta(**{unit:num if time_type == "add" else -num})
953
954
  return int(stamp_time.timestamp()*1000)
954
955
 
956
+
955
957
  def get_line_info(data):
956
958
  env = data["env"]
957
959
  headers = data["headers"]
@@ -2453,10 +2455,10 @@ def get_merchant_currency(data):
2453
2455
 
2454
2456
 
2455
2457
  if __name__=="__main__":
2456
- data ={'headers': {'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkZmQxYjNiMDc0M2JmYWU4YTFkODk4NzczNjgyZWVkZCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVlYjkwMzVhYjA5ZDEyNjU4NTFmOTU2ZiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.Y90xLfYVAp9yByHo7Vc7A3hHrp6hX9X9Lg4mg_WiE_I', 'lang': 'en', 'Content-Type': 'application/json'}, 'page_id': '17841450795887194', 'post_id': '18032025731245871', 'env': 'https://front-admin-preview.shoplineapp.com', 'sales_id': '498232', 'key': '5e3bba98882fc0fb22a0607238bc5b8f', 'platform': 'INSTAGRAM', 'name': '接口自动化广播名称1740286371978'}
2457
- broadcast_id,reponse = get_broadcast_list(data)
2458
- print(reponse)
2459
- print(broadcast_id)
2458
+ stamp1 = get_stamp_time({"num":5040})
2459
+ print(stamp1)
2460
+ stamp2 = get_stamp_time({"num": 6000})
2461
+ print(stamp2)
2460
2462
 
2461
2463
 
2462
2464
 
@@ -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.8
3
+ Version: 2.9.0
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.8',
5
+ version='2.9.0',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),