Commit 985d7ad2 by shenjunjie

热点库-实时热点榜

parent 25c1b130
...@@ -135,24 +135,16 @@ public class AppHotController extends BaseController { ...@@ -135,24 +135,16 @@ public class AppHotController extends BaseController {
@LogRecord(description = "热点库") @LogRecord(description = "热点库")
@GetMapping("/getHotList") @GetMapping("/getHotList")
public ResponseResult getHotList(@RequestParam(value = "sortType", defaultValue = "realTime") String sortType, public ResponseResult getHotList(@RequestParam(value = "sortType", defaultValue = "realTime") String sortType,
@RequestParam(value = "type", defaultValue = "weibo") String type) { @RequestParam(value = "type", defaultValue = "weibo") String type,
ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(trendsListUrl, JSONObject.class, sortType, type); @RequestParam(value = "day", required = false) String day) {
Object data = jsonObjectResponseEntity.getBody().get("data"); ResponseEntity<JSONObject> jsonObjectResponseEntity;
String redisKey = RedisKeyPrefix.HOT_LIST + type; jsonObjectResponseEntity = restTemplate.getForEntity(trendsListUrl, JSONObject.class, sortType, type, day);
String result = redisUtil.get(redisKey); Object data = Objects.requireNonNull(jsonObjectResponseEntity.getBody()).get("data");
// 当舆论场崩溃时从缓存里获取
if (Objects.nonNull(data)) { if (Objects.nonNull(data)) {
if (Objects.isNull(result)) {
redisUtil.setExpire(redisKey, JSON.toJSONString(data), ONE_HOUR, TimeUnit.HOURS);
}
return ResponseResult.success(data); return ResponseResult.success(data);
} else {
if (Objects.nonNull(result)) {
return ResponseResult.success(result);
} }
return ResponseResult.failure("响应超时"); return ResponseResult.failure("响应超时");
} }
}
@ApiOperation("热点库-热点榜单") @ApiOperation("热点库-热点榜单")
@GetMapping("/hot") @GetMapping("/hot")
......
...@@ -81,7 +81,7 @@ crisis.list.url=https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&s ...@@ -81,7 +81,7 @@ crisis.list.url=https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&s
crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1} crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2} crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3 #\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2} trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}
......
...@@ -84,7 +84,7 @@ crisis.list.url=https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&s ...@@ -84,7 +84,7 @@ crisis.list.url=https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&s
crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1} crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2} crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3 #\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2} trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}
......
...@@ -81,7 +81,7 @@ crisis.list.url=https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&s ...@@ -81,7 +81,7 @@ crisis.list.url=https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&s
crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1} crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2} crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3 #\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2} trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}
......
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