Commit 1f48ab80 authored by wenwen.tang's avatar wenwen.tang 😕

适配新数据源

parent 71c9d2a6
......@@ -197,7 +197,6 @@ def ths_token():
getAccessTokenHeader = {"Content-Type": "application/json", "refresh_token": refreshtoken}
getAccessTokenResponse = requests.post(url=getAccessTokenUrl, headers=getAccessTokenHeader)
accessToken = json.loads(getAccessTokenResponse.content)['data']['access_token']
print(accessToken)
return accessToken
@component(bean_name='eco-sync')
......@@ -347,6 +346,8 @@ class ExrateSync(DataSync):
start_date = next_workday(last_one['date']) if last_one else self.start_date
response = self.exrate_ths(code=ticker, start_date=start_date)
response = response['tables'][0]
if response.get('time') is None or len(response['time']) == 0:
continue
save_dates = [{
'ticker': ticker,
'date': date,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment