add workflow 天润Smart-ccc会话数据,dev

This commit is contained in:
root 2024-07-03 13:38:54 +08:00
parent 27df073e70
commit 62c21c1f1f
1 changed files with 9 additions and 2 deletions

View File

@ -25,7 +25,14 @@ nonce = str(uuid.uuid4())
current_time_utc =( datetime.datetime.now() - datetime.timedelta(hours=8)).strftime("%Y-%m-%dT%H:%M:%SZ") current_time_utc =( datetime.datetime.now() - datetime.timedelta(hours=8)).strftime("%Y-%m-%dT%H:%M:%SZ")
formatted2_current_date = current_date.strftime("%Y-%m-%d %H:%M:%S") # 获取当前日期 - 标准化 formatted2_current_date = current_date.strftime("%Y-%m-%d %H:%M:%S") # 获取当前日期 - 标准化
formatted2_previous_date = previous_date.strftime("%Y-%m-%d %H:%M:%S") # 获取前一天日期 - 标准化
def formatted2_previous_date(d):
if h==0:
return datetime.date.today().strftime("%Y%m%d")
# 减去一个小时,得到前一个小时的开始时间
start_of_previous_date = datetime.date.today() - datetime.timedelta(days=d)
return start_of_previous_date.strftime("%Y%m%d")
def formatted2_previous_hour(h): def formatted2_previous_hour(h):
if h==0: if h==0:
@ -64,7 +71,7 @@ def build_query_string(params):
def request_data_signature_get(): def request_data_signature_get():
print(f'开始请求会话记录数据') print(f'开始请求会话记录数据')
url='https://api-bj.clink.cn/livechat/copy_chat_records' url='https://api-bj.clink.cn/livechat/copy_chat_records'
param={'Timestamp':current_time_utc,'Expires':86400,'date':formatted2_previous_date,'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177',} param={'Timestamp':current_time_utc,'Expires':86400,'date':formatted2_previous_date(0),'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177'}
print(f'param: {param}') print(f'param: {param}')
url_path = build_query_string(param) url_path = build_query_string(param)
url_param = url_path url_param = url_path