dto
This commit is contained in:
@@ -9,6 +9,7 @@ import com.peanut.modules.book.service.BookClockEntryChatService;
|
||||
import com.peanut.modules.book.service.BookClockEntryService;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import com.peanut.modules.book.service.UserBookClockService;
|
||||
import com.peanut.modules.book.to.PageIdDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -30,18 +31,15 @@ public class UserClockController {
|
||||
|
||||
/**
|
||||
* 获取书打卡列表
|
||||
* @param bookId
|
||||
* @param limit
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getBookClocks")
|
||||
public R getBookClocks(@RequestParam Integer bookId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||
public R getBookClocks(@RequestBody PageIdDto page){
|
||||
LambdaQueryWrapper<BookClockEntryEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookClockEntryEntity::getBookId,bookId);
|
||||
wrapper.eq(BookClockEntryEntity::getBookId,page.getId());
|
||||
wrapper.eq(BookClockEntryEntity::getDelFlag,0);
|
||||
wrapper.orderByAsc(BookClockEntryEntity::getDay);
|
||||
Page<BookClockEntryEntity> bookClockEntryEntityPage = bookClockEntryService.getBaseMapper().selectPage(new Page<BookClockEntryEntity>(page, limit), wrapper);
|
||||
Page<BookClockEntryEntity> bookClockEntryEntityPage = bookClockEntryService.getBaseMapper().selectPage(new Page<BookClockEntryEntity>(page.getPage(), page.getLimit()), wrapper);
|
||||
return R.ok().put("page",bookClockEntryEntityPage);
|
||||
}
|
||||
|
||||
|
||||
15
src/main/java/com/peanut/modules/book/to/PageIdDto.java
Normal file
15
src/main/java/com/peanut/modules/book/to/PageIdDto.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.peanut.modules.book.to;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class PageIdDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer limit;
|
||||
|
||||
private Integer page;
|
||||
}
|
||||
Reference in New Issue
Block a user