{ "data": [ { "word": "国乒男团卫冕夺第35金", "url": "https://www.baidu.com/s?wd=国乒男团卫冕夺第35金" }, { "word": "刘诗颖一掷乾坤夺女子标枪金牌", "url": "https://www.baidu.com/s?wd=刘诗颖一掷乾坤夺女子标枪金牌" }, { "word": "全红婵家门口堆满辣条", "url": "https://www.baidu.com/s?wd=全红婵家门口堆满辣条" }, { "word": "许昕球打到马龙背上", "url": "https://www.baidu.com/s?wd=许昕球打到马龙背上" }, { "word": "国防部回应美国务院批准对台军售", "url": "https://www.baidu.com/s?wd=国防部回应美国务院批准对台军售" }, { "word": "庞倩玉获摔跤自由式53公斤级银牌", "url": "https://www.baidu.com/s?wd=庞倩玉获摔跤自由式53公斤级银牌" }, { "word": "国乒闪耀东京4金3银收官", "url": "https://www.baidu.com/s?wd=国乒闪耀东京4金3银收官" }, { "word": "马龙奥运5金!历史第一人", "url": "https://www.baidu.com/s?wd=马龙奥运5金!历史第一人" }, { "word": "流调成吃瓜素材?多位当事人发声", "url": "https://www.baidu.com/s?wd=流调成吃瓜素材?多位当事人发声" }, { "word": "武汉增6例本土确诊10例本土无症状", "url": "https://www.baidu.com/s?wd=武汉增6例本土确诊10例本土无症状" }, { "word": "律师解读全季一裸男闯女住客房间", "url": "https://www.baidu.com/s?wd=律师解读全季一裸男闯女住客房间" }, { "word": "樊振东的神仙球", "url": "https://www.baidu.com/s?wd=樊振东的神仙球" }, { "word": "霍启刚分享郭晶晶东京奥运生活", "url": "https://www.baidu.com/s?wd=霍启刚分享郭晶晶东京奥运生活" }, { "word": "上海小学期末不考英语非新规", "url": "https://www.baidu.com/s?wd=上海小学期末不考英语非新规" }, { "word": "孙春兰赴郑州调研:对院感零容忍", "url": "https://www.baidu.com/s?wd=孙春兰赴郑州调研:对院感零容忍" }, { "word": "杨倩要和全红婵组团去抓娃娃", "url": "https://www.baidu.com/s?wd=杨倩要和全红婵组团去抓娃娃" }, { "word": "裸男闯女顾客房间 全季酒店回应", "url": "https://www.baidu.com/s?wd=裸男闯女顾客房间 全季酒店回应" }, { "word": "武汉104个小区实行封控管理", "url": "https://www.baidu.com/s?wd=武汉104个小区实行封控管理" }, { "word": "许昕说再打几年不是大问题", "url": "https://www.baidu.com/s?wd=许昕说再打几年不是大问题" }, { "word": "尹笑言获空手道女子61公斤级银牌", "url": "https://www.baidu.com/s?wd=尹笑言获空手道女子61公斤级银牌" }, { "word": "央视评踹门查补课:执法勿简单粗暴", "url": "https://www.baidu.com/s?wd=央视评踹门查补课:执法勿简单粗暴" }, { "word": "七夕逢周末能登记结婚吗?多地回应", "url": "https://www.baidu.com/s?wd=七夕逢周末能登记结婚吗?多地回应" }, { "word": "中国女子4x100接力第6名", "url": "https://www.baidu.com/s?wd=中国女子4x100接力第6名" }, { "word": "水谷隼告别日本国家队", "url": "https://www.baidu.com/s?wd=水谷隼告别日本国家队" }, { "word": "跨省游被叫停 旅游业盛夏遇寒流", "url": "https://www.baidu.com/s?wd=跨省游被叫停 旅游业盛夏遇寒流" }, { "word": "第一次见这么拿冠军的", "url": "https://www.baidu.com/s?wd=第一次见这么拿冠军的" }, { "word": "男子举报别人吸毒反被抓", "url": "https://www.baidu.com/s?wd=男子举报别人吸毒反被抓" }, { "word": "盖茨正式离婚后首发声", "url": "https://www.baidu.com/s?wd=盖茨正式离婚后首发声" }, { "word": "“祝融号”行驶里程突破800米", "url": "https://www.baidu.com/s?wd=“祝融号”行驶里程突破800米" }, { "word": "泰国男星Toytoy杀死女友", "url": "https://www.baidu.com/s?wd=泰国男星Toytoy杀死女友" } ] }
暂无
controller
@GetMapping("/findKnow") public @ResponseBody Object findKnow() { BaiDuHotUtil api = new BaiDuHotUtil(); //String run = null; try { run = api.run(BAIDU_URL); JSONObject object = JSON.parseObject(run,JSONObject.class); System.out.println(object); return object; } catch (Exception e) { logger.error("/newsBanner/request is error" + e.getMessage()); return R.failed("获取百度热搜异常"); } }
utils
public class BaiDuHotUtil { OkHttpClient client = new OkHttpClient(); public String run(String url) throws IOException { Request request = new Request.Builder() .url(url) .build(); try (Response response = client.newCall(request).execute()) { return response.body().string(); } } }