idea userService的list底形转不到page对象里去
问题:CommonPage(pageNumber=2, pageSize=20, totalPage=1, total=2, list=[])
目标代码:
@GetMapping("/userlist")
public String userList(UserListPageDto userListPageDto, Model model) {
Integer pageNumber = userListPageDto.getPageNumber();
Integer pageSize = userListPageDto.getPageSize();
IPage<User> userPage = new Page<>(pageNumber,pageSize);
//降序排序
LambdaQueryWrapper<User> userLambdaQueryWrapper = Wrappers.<User>lambdaQuery().orderByDesc(User::getUserRegisterTime);
// 转换格式
IPage<User> userIPage = iUserService.page(userPage, userLambdaQueryWrapper);
model.addAttribute("userPage",CommonPage.restPage(userIPage));
return "/admin/userlist";
}
使用的mybatis-plus
怎么改都为list[],但是直接输出iUserService是有数值的
User(userId=1, userName=my, userPassword=12345, userRegisterTime=Tue Mar 29 20:26:29 CST 2022, userStatus=0)
User(userId=2, userName=sss, userPassword=12345, userRegisterTime=Tue Mar 29 20:27:31 CST 2022, userStatus=1)
改了一天了没找出方法望大佬指正