找回controller,修复state bug

This commit is contained in:
wangjinlei
2023-10-26 10:51:12 +08:00
parent 0658e0a325
commit c4988de124
2 changed files with 47 additions and 2 deletions

View File

@@ -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<BookEntity> 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<BookEntity> userClockBestBooks = bookService.getUserClockBestBooks(userId, limit, page);
return R.ok().put("page",userClockBestBooks);
}
}

View File

@@ -153,7 +153,7 @@ public class BookForumArticlesServiceController {
LambdaQueryWrapper<BookEntity> 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<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
@@ -179,7 +179,7 @@ public class BookForumArticlesServiceController {
LambdaQueryWrapper<BookEntity> 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<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);