Files
nuttyreading-java/src/main/java/com/peanut/modules/book/controller/BookClockinPunchController.java
wangjinlei 57641b2e2a log-slf4j
2023-11-22 10:45:21 +08:00

47 lines
1.4 KiB
Java

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 lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Slf4j
@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);
}
}