赞
踩
@RequestMapping("list2")
@ResponseBody
public List<Map<Long, List<PlanDO>>> getList2() {
List<PlanDO> list = new ArrayList<>();
list.add(new PlanDO(1l,1l,"0",new Date()));
list.add(new PlanDO(2l,116l,"0",new Date()));
list.add(new PlanDO(3l,118l,"0",new Date()));
list.add(new PlanDO(6l,1l,"0",new Date()));
list.add(new PlanDO(5l,116l,"0",new Date()));
list.add(new PlanDO(4l,118l,"0",new Date()));
Map<Long, List<PlanDO>> collect = list.stream().collect(Collectors.groupingBy(PlanDO::getUserId));
List<Map<Long, List<PlanDO>>> maps1 = new ArrayList<>();
maps1.add(collect);
return maps1;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。