diff --git a/src/main/java/com/peanut/modules/book/controller/BookClockinPunchController.java b/src/main/java/com/peanut/modules/book/controller/BookClockinPunchController.java new file mode 100644 index 00000000..5512104f --- /dev/null +++ b/src/main/java/com/peanut/modules/book/controller/BookClockinPunchController.java @@ -0,0 +1,45 @@ +package com.peanut.modules.book.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.peanut.common.utils.R; +import com.peanut.modules.book.entity.BookEntity; +import com.peanut.modules.book.service.BookService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("book/clockinPunch") +public class BookClockinPunchController { + @Autowired + private BookService bookService; + + + /** + * 获取我的打卡已购书 + * @param userId + * @param limit + * @param page + * @return + */ + @RequestMapping("/myClockBooks") + public R myClockBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){ + Page userClockBooks = bookService.getUserClockBooks(userId, limit, page); + return R.ok().put("page",userClockBooks); + } + + /** + * 获取打卡推荐图书 + * @param userId + * @param limit + * @param page + * @return + */ + @RequestMapping("/getBestClockBooks") + public R getBestClockBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){ + Page userClockBestBooks = bookService.getUserClockBestBooks(userId, limit, page); + return R.ok().put("page",userClockBestBooks); + } + + +} + diff --git a/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java b/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java index 9eb290f6..5134baf6 100644 --- a/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java +++ b/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java @@ -153,7 +153,7 @@ public class BookForumArticlesServiceController { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(BookEntity::getDelFlag,0); - wrapper.eq(BookEntity::getState,0); + wrapper.eq(BookEntity::getState,1); wrapper.exists(ex_sql); wrapper.exists(existSql); Page bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper); @@ -179,7 +179,7 @@ public class BookForumArticlesServiceController { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(BookEntity::getDelFlag,0); - wrapper.eq(BookEntity::getState,0); + wrapper.eq(BookEntity::getState,1); wrapper.notExists(ex_sql); wrapper.exists(existSql); Page bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);