Merge remote-tracking branch 'origin/retifive' into retifive

This commit is contained in:
zhangjian
2024-05-10 08:40:12 +08:00

View File

@@ -214,12 +214,7 @@ public class RefinitivConsumer implements ApplicationRunner {
}
List<String> topSymbols = RefinitivUtil.decodeTopData(result[0]);
for (String topSymbol : topSymbols) {
RetifiveStockInfo stockInfo = getDetail(topSymbol);
list.add(stockInfo);
}
return list;
return getStockList(String.join(",", topSymbols));
}
/**
@@ -350,7 +345,8 @@ public class RefinitivConsumer implements ApplicationRunner {
.header("Authorization","Bearer " + token)
.execute();
if(response.getStatus() != 200){
throw new SysTipsException("获取股票K线失败");
log.error("获取股票k线信息失败,code:"+response.getStatus());
return result;
}
JSONArray jsonArray = JSONArray.parseArray(response.body());
JSONArray dateArray = JSONObject.parseObject(jsonArray.get(0).toString()).getJSONArray("data");
@@ -476,7 +472,8 @@ public class RefinitivConsumer implements ApplicationRunner {
.basicAuth(appKey,"")
.execute();
if(response.getStatus() != 200){
throw new SysTipsException("获取token失败");
log.error("获取toekn失败,code:"+response.getStatus());
return null;
}
JSONObject data = JSONObject.parseObject(response.body());
data.put("expiry_tm",System.currentTimeMillis() + (Long.valueOf(data.get("expires_in").toString())-10));