import com.github.pagehelper.Page;
需要导入的jar Controller
import com.github.pagehelper.PageInfo;
@RequestMapping(value = "/getMoreBook",produces="application/json;charset=utf-8")//处理返回中文乱码
@ResponseBody
public String getMoreBook(String type,String majorCate,@RequestParam(required = false,defaultValue = "1")String page) {
PageInfo books=new PageInfo();
books=bookServiceImpl.getMoreBook(type,majorCate,page);
JSONObject jsObj= new JSONObject();
jsObj.put("status",1);
jsObj.put("msg","ok");
jsObj.put("content",books);
return jsObj.toString();
}
Service
PageInfo getMoreBook(String type, String majorCate, String page);
ServiceImpl
public PageInfo getMoreBook(String type, String majorCate, String page){