IPage<IotOldUser> pageList = iotOldUserService.page(page, queryWrapper); if(CollectionUtils.isNotEmpty(pageList.getRecords())){ SimplePropertyPreFilter filter = new SimplePropertyPreFilter(IotOldUser.class, "id","name","cardNumber"); JSONArray jsonArray = JSONArray.parseArray(JSONObject.toJSONString(pageList.getRecords(),filter)); pageList.setRecords(jsonArray.toJavaList(IotOldUser.class)); }
后端返回分页数据过滤不需要的字段,先将不需要的属性置为null
最新推荐文章于 2024-01-08 11:12:46 发布