第一种
@PostMapping("queryByPage")
public PageInfo queryByPage(@RequestBody AuthCustomer authCustomer,@RequestParam Integer pageNum,@RequestParam Integer pageSize) {
PageHelper.startPage(pageNum,pageSize);
List<AuthCustomer> list = authCustomerService.queryByPage(authCustomer);
return new PageInfo<>(list);
}
http://localhost:8080/cloud-pso-api/authCustomer/queryByPage_?pageNum=1&pageSize=1
第二种 是无意中测试发现的,还不知道是什么原理
@PostMapping("queryByPage_")
public PageInfo queryByPage_(@RequestBody AuthCustomer authCustomer) {
List<AuthCustomer> list = authCustomerService.queryByPage(authCustomer);
return new PageInfo<>(list);
}
在查询bean中添加 pageNum,pageSize 并获取get,set方法
private int pageNum;
private int pageSize;