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
关键词由CSDN通过智能技术生成