Commit e687a97a by shenjunjie

Merge branch 'release' into 'master'

Release

See merge request !360
parents cfcd1b88 7d0b286a
...@@ -416,15 +416,17 @@ public class AppHotController extends BaseController { ...@@ -416,15 +416,17 @@ public class AppHotController extends BaseController {
List<JSONObject> lastList = source.stream().filter(json -> json.getLong("startTime") >= (timeRange[0] - space) && json.getLong("startTime") < timeRange[0]).collect(Collectors.toList()); List<JSONObject> lastList = source.stream().filter(json -> json.getLong("startTime") >= (timeRange[0] - space) && json.getLong("startTime") < timeRange[0]).collect(Collectors.toList());
result.put("currentCount", list.size()); result.put("currentCount", list.size());
result.put("lastCount", list.size() - lastList.size()); result.put("lastCount", list.size() - lastList.size());
Map<String, List<JSONObject>> platformMap = list.stream().collect(Collectors.groupingBy(json -> HotPlatformEnum.convertPlatform(json.getString("type")))); if (!list.isEmpty()) {
List<JSONObject> platformCount = new ArrayList<>(); Map<String, List<JSONObject>> platformMap = list.stream().collect(Collectors.groupingBy(json -> HotPlatformEnum.convertPlatform(json.getString("type"))));
platformMap.forEach((platform, datas) -> { List<JSONObject> platformCount = new ArrayList<>();
JSONObject json = new JSONObject(); platformMap.forEach((platform, datas) -> {
json.put("platform", platform); JSONObject json = new JSONObject();
json.put("count", datas.size()); json.put("platform", platform);
platformCount.add(json); json.put("count", datas.size());
}); platformCount.add(json);
result.put("platformCount", platformCount); });
result.put("platformCount", platformCount);
}
result.put("averageCount", source.size() / (Constant.ONE_YEAR / space)); result.put("averageCount", source.size() / (Constant.ONE_YEAR / space));
return result; return result;
} }
......
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