Commit 156cc44b by shenjunjie

热点库-实时热点榜4

parent edf2de62
......@@ -103,14 +103,14 @@ public class AppHotController extends BaseController {
return ResponseResult.failure("响应超时");
}
// 查询在榜数据
ResponseEntity<JSONObject> responseEntity = restTemplate.getForEntity(trendsListUrl, JSONObject.class, "realTime", type, null);
ResponseEntity<JSONObject> responseEntity = restTemplate.getForEntity(trendsListUrl, JSONObject.class, null, type, null);
if (Objects.isNull(responseEntity.getBody())) {
return ResponseResult.success(result);
}
List<String> rankingIds = responseEntity.getBody().getJSONArray("data").stream().map(obj -> ((JSONObject) obj).getString("id")).collect(Collectors.toList());
List<String> rankingIds = responseEntity.getBody().getJSONArray("data").stream().map(obj -> ((JSONObject) obj).getString("_id")).collect(Collectors.toList());
List<JSONObject> list = result.getJSONArray("data").stream().map(obj -> {
JSONObject json = (JSONObject) obj;
if (rankingIds.contains(json.getString("id"))||json.getString("id").contains("测试")) {
if (rankingIds.contains(json.getString("id"))) {
json.put("inTheList", true);
}
return json;
......
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