分页调用远程数据
public static void main(String[] args) { List<PowerBasicSupplierAccount> list = new ArrayList<>(); PowerBasicSupplierAccount pageInfo = new PowerBasicSupplierAccount(); pageInfo.setAccount("张学友"); PowerBasicSupplierAccount rpk = new PowerBasicSupplierAccount(); rpk.setAccount("刘德华"); PowerBasicSupplierAccount fest = new PowerBasicSupplierAccount(); fest.setAccount("郭富城"); PowerBasicSupplierAccount eeef = new PowerBasicSupplierAccount(); eeef.setAccount("黎明"); PowerBasicSupplierAccount qwe = new PowerBasicSupplierAccount(); qwe.setAccount("费翔"); PowerBasicSupplierAccount wsx = new PowerBasicSupplierAccount(); wsx.setAccount("王杰"); PowerBasicSupplierAccount tfdj = new PowerBasicSupplierAccount(); tfdj.setAccount("周星驰"); PowerBasicSupplierAccount qwrer = new PowerBasicSupplierAccount(); qwrer.setAccount("王大康"); list.add(pageInfo); list.add(rpk); list.add(fest); list.add(eeef); list.add(qwe); list.add(wsx); list.add(tfdj); list.add(qwrer); int pageSize = 3;//每页3条数据 //定义分页参数 int totalPageNum = list.size() % pageSize == 0 ? list.size() / pageSize : list.size() / pageSize + 1; for (int i = 2; i <= totalPageNum; i++) { //调用接口第二页数据,每页数据为3条 System.out.println("调用第二页数据,以此类推到totalPageNum页"); } }