新闻测试

This commit is contained in:
dengli
2024-01-10 10:15:48 +08:00
parent e87c451b3f
commit c7284e8081

View File

@@ -174,7 +174,7 @@ public class StockApiController {
String news = stockService.getNews();
List<String> newsList = Arrays.asList(news.split("<a href="));
newsList = newsList.subList(1, newsList.size());
return ServerResponse.createBySuccess(newsList);
return ServerResponse.createBySuccess(stockService.getNewsInfo("https://www.business-standard.com/markets/news/bajaj-auto-s-m-cap-surpasses-rs-2-trillion-mark-on-rs-4-000-crore-buyback-124010900178_1.html"));
/*newsList.forEach( n -> {
String contentUrl = n.substring(1, n.indexOf("class=\"img-smllnews\"") - 2);
String id = contentUrl.substring(contentUrl.lastIndexOf("-") + 1, contentUrl.lastIndexOf("_"));