新版
This commit is contained in:
@@ -132,8 +132,9 @@ public class BookForumArticlesServiceController {
|
|||||||
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
||||||
|
|
||||||
for (BookEntity b :bookEntityPage.getRecords()){
|
for (BookEntity b :bookEntityPage.getRecords()){
|
||||||
List<BookForumArticlesEntity> forumsLimit = bookForumArticlesService.getForumsLimit(b.getId(), 4);
|
b.setForums(bookForumArticlesService.getForumsLimit(b.getId(), 4));
|
||||||
b.setForums(forumsLimit);
|
|
||||||
|
b.setForumNum(bookForumArticlesService.getForumsCount(b.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return R.ok().put("page",bookEntityPage);
|
return R.ok().put("page",bookEntityPage);
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.peanut.modules.book.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("book/teach")
|
||||||
|
public class BookTeachController {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
10
src/main/java/com/peanut/modules/book/dao/BookTeachDao.java
Normal file
10
src/main/java/com/peanut/modules/book/dao/BookTeachDao.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package com.peanut.modules.book.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||||
|
import com.peanut.modules.book.entity.BookTeachEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface BookTeachDao extends MPJBaseMapper<BookTeachEntity> {
|
||||||
|
}
|
||||||
@@ -163,6 +163,9 @@ public class BookEntity implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<BookForumArticlesEntity> forums;
|
private List<BookForumArticlesEntity> forums;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer forumNum;
|
||||||
|
|
||||||
|
|
||||||
// @TableField(exist = false)
|
// @TableField(exist = false)
|
||||||
// private Boolean bookAuthen;
|
// private Boolean bookAuthen;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class BookForumArticlesEntity {
|
|||||||
@TableField("bookid")
|
@TableField("bookid")
|
||||||
private Integer bookid;
|
private Integer bookid;
|
||||||
|
|
||||||
@TableField("fine_work")
|
@TableField("finework")
|
||||||
private Integer finework;
|
private Integer finework;
|
||||||
/**
|
/**
|
||||||
*开始时间
|
*开始时间
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.peanut.modules.book.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("book_teach")
|
||||||
|
public class BookTeachEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
@TableField("teach_id")
|
||||||
|
private Integer teachID;
|
||||||
|
@TableField("book_id")
|
||||||
|
private Integer bookId;
|
||||||
|
|
||||||
|
private Integer chapter;
|
||||||
|
|
||||||
|
private String voices;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@TableField("create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@TableField("del_flag")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.peanut.modules.book.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.book.entity.BookTeachEntity;
|
||||||
|
|
||||||
|
public interface BookTeachService extends IService<BookTeachEntity> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.book.dao.BookTeachDao;
|
||||||
|
import com.peanut.modules.book.entity.BookTeachEntity;
|
||||||
|
import com.peanut.modules.book.service.BookTeachService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BookTeachServiceImpl extends ServiceImpl<BookTeachDao, BookTeachEntity> implements BookTeachService {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user