|
@@ -6,6 +6,8 @@ package com.kexun.controller;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.kexun.common.utils.Result;
|
|
|
import com.kexun.entity.*;
|
|
|
import com.kexun.service.CooperatorService;
|
|
@@ -36,16 +38,20 @@ public class CooperatorController {
|
|
|
|
|
|
// 获取合作方信息
|
|
|
@GetMapping("cooperatorList")
|
|
|
- public Result cooperatorList() {
|
|
|
+ public Result cooperatorList(@RequestParam int pageNum) {
|
|
|
+ int pageSize = 10;
|
|
|
+ PageHelper.startPage(pageNum, pageSize);//设置分页信息
|
|
|
JSONObject resJson=new JSONObject();
|
|
|
- List<CooperatorInfo> list= CooperatorService.list();
|
|
|
+ List<CooperatorInfo> list= CooperatorService.selectPage();
|
|
|
|
|
|
for(int i=0; i<list.size(); i++)
|
|
|
{
|
|
|
String time = list.get(i).getCreateTime().replace(".0","");
|
|
|
list.get(i).setCreateTime(time);
|
|
|
}
|
|
|
- resJson.put("cooperator_List",list);
|
|
|
+ PageInfo pageInfo=new PageInfo(list);
|
|
|
+
|
|
|
+ resJson.put("cooperator_List",pageInfo);
|
|
|
// System.out.println(list);
|
|
|
|
|
|
return Result.success("ok",resJson);
|