From 508047c9a4fb4754efb3d400250a324ba3c91302 Mon Sep 17 00:00:00 2001 From: huangweixiong Date: Fri, 17 Jun 2022 18:09:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=9B=AE=E5=BD=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=88=86=E9=A1=B5=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/controller/ResourceController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 2aa94c42..aefcdf6c 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -316,14 +316,18 @@ public class ResourceController { String startTag = ""; String endTag = ""; String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag)); - List results = JSONObject.parseObject(json, LinkedList.class); + HashMap result = JSONObject.parseObject(json, HashMap.class); - List objects = results.stream() + List rows = (List) result.get("data"); + + + List 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));