This commit is contained in:
wangjinlei
2023-09-21 17:27:13 +08:00
parent ac80121377
commit c4cc7fc129

View File

@@ -1,6 +1,7 @@
package com.peanut.modules.book.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.R;
@@ -44,7 +45,7 @@ public class UserEbookBuyController {
/**
* 获取用户打开书列表
* 获取用户可打卡书列表
* @return
*/
@RequestMapping("/getUserClockBookList")
@@ -116,7 +117,12 @@ public class UserEbookBuyController {
*/
@RequestMapping("/getUserCanlistenBooks")
public R getUserCanlistenBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
return R.ok();
MPJLambdaWrapper<BookEntity> wrapper = new MPJLambdaWrapper<BookEntity>();
wrapper.selectAll(BookEntity.class);
wrapper.leftJoin(UserEbookBuyEntity.class,UserEbookBuyEntity::getBookId,BookEntity::getId);
wrapper.eq(UserEbookBuyEntity::getUserId,userId);
Page<BookEntity> bookEntityPage = bookDao.selectJoinPage(new Page<BookEntity>(page, limit), BookEntity.class, wrapper);
return R.ok().put("page",bookEntityPage);
}
@RequestMapping("/buylist")