From de25dc81a5d0889797e0d626e229f96855ca50a6 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 2 Jul 2024 10:43:45 +0800 Subject: [PATCH] =?UTF-8?q?add=20workflow=20=E5=A4=A9=E6=B6=A6Smart-ccc?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=95=B0=E6=8D=AE,dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smart_ccc/获取工单记录列表/tickets_list_feign.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/workflow/TK_Cust/smart_ccc/获取工单记录列表/tickets_list_feign.py b/dev/workflow/TK_Cust/smart_ccc/获取工单记录列表/tickets_list_feign.py index a218252..16eae62 100644 --- a/dev/workflow/TK_Cust/smart_ccc/获取工单记录列表/tickets_list_feign.py +++ b/dev/workflow/TK_Cust/smart_ccc/获取工单记录列表/tickets_list_feign.py @@ -65,11 +65,11 @@ def build_query_string(params): def request_data_signature_post(): print(f'开始请求工单列表数据:{formatted2_previous_hour(0)}') url='https://api-bj.clink.cn/ticket/list_ticket' - header={} - param={'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177','Timestamp':current_time_utc,'Expires':'86400',} + header={'Content-Type':'application/json;charset=UTF-8'} + param={'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177','Timestamp':current_time_utc,'Expires':86400} print(f'param: {param}') url_path = build_query_string(param) - url_param = url_path + url_param = build_query_string(param) print(f'url_param: {url_param}') url_param = f'POSTapi-bj.clink.cn/ticket/list_ticket?{url_param}' print(f'url_param2: {url_param}') @@ -77,10 +77,10 @@ def request_data_signature_post(): print(f'signature: {signature}') url = f'{url}?{url_path}&Signature={signature}' print(f'url: {url}') - body={'endTime':'2024-01-01 00:00:00','startTime':formatted2_previous_hour(1)} + body={'endTime':formatted2_previous_hour(1),'startTime':'2024-01-01 00:00:00'} #body={'endTime':formatted2_previous_hour(0),'startTime':formatted2_previous_hour(1)} print(f'body: {body}') - dataReqL=requests.post(url,headers=header,params=body) + dataReqL=requests.post(url,headers=header,data=json.dumps(body)) i = 0 while 'error' in dataReqL and i < 5: time.sleep(1)