SpringBoot学习记录(十五)-------- SpringBoot接收前端发送的json数据

    @RequestMapping("/findByPage1")
    @ResponseBody
    public IPage<Weixinuser> findByPage(@RequestBody Paging pagee){
        int pageNo = pagee.getPageNo();
        Page<Weixinuser> page = new Page<>(pageNo,6);
        return weiXinUserService.findByPage(page);

@RequestMapping("/findByPage1"):定义一个名为"/findByPage1"的接口。
@ResponseBody: 加在方法上,当访问该接口时会返回json数据。
@RequestBody: 接收前端发送的json数据,其中Paging是封装好的实体。

发布了73 篇原创文章 · 获赞 7 · 访问量 9702

猜你喜欢

转载自blog.csdn.net/GaoXiR/article/details/104710782