Commit 156cc44b by shenjunjie

热点库-实时热点榜4

parent edf2de62
...@@ -103,14 +103,14 @@ public class AppHotController extends BaseController { ...@@ -103,14 +103,14 @@ public class AppHotController extends BaseController {
return ResponseResult.failure("响应超时"); 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())) { if (Objects.isNull(responseEntity.getBody())) {
return ResponseResult.success(result); 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 -> { List<JSONObject> list = result.getJSONArray("data").stream().map(obj -> {
JSONObject json = (JSONObject) 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); json.put("inTheList", true);
} }
return json; 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