资源目录列表增加分页总数

This commit is contained in:
huangweixiong 2022-06-17 18:09:05 +08:00
parent 593aa55e24
commit 508047c9a4
1 changed files with 7 additions and 3 deletions

View File

@ -316,14 +316,18 @@ public class ResourceController {
String startTag = "<ZWCJ_mainPortResult>";
String endTag = "</ZWCJ_mainPortResult>";
String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag));
List<Map> results = JSONObject.parseObject(json, LinkedList.class);
HashMap result = JSONObject.parseObject(json, HashMap.class);
List<Object> objects = results.stream()
List<Map> rows = (List<Map>) result.get("data");
List<Object> objects = rows.stream()
.filter(item -> item.get("main") != null)
.map(item -> item.get("main"))
.collect(Collectors.toList());
result.put("data", objects);
return new Result().ok(objects);
return new Result().ok(result);
} catch (Exception e) {
e.printStackTrace();
return new Result().ok(new ArrayList(0));