From c4988de124573d5927df127f1791f86d26c39687 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Thu, 26 Oct 2023 10:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=BE=E5=9B=9Econtroller=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dstate=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookClockinPunchController.java | 45 +++++++++++++++++++ .../BookForumArticlesServiceController.java | 4 +- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/peanut/modules/book/controller/BookClockinPunchController.java 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);