This commit is contained in:
wangjinlei
2023-09-26 16:55:44 +08:00
parent e42d0243cd
commit 1755a78a8d
16 changed files with 159 additions and 146 deletions

View File

@@ -1,16 +1,13 @@
package com.peanut.modules.book.service.impl;
import cn.com.marsoft.base.impl.BaseServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query;
import com.peanut.modules.app.entity.UserEntity;
import com.peanut.modules.app.service.UserService;
import com.peanut.modules.book.dao.BookForumCommentDao;
import com.peanut.modules.book.entity.BookForumArticlesEntity;
import com.peanut.modules.book.entity.BookForumCommentEntity;
import com.peanut.modules.book.service.BookForumCommenService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -83,6 +80,19 @@ public class BookForumCommenServiceImpl extends ServiceImpl<BookForumCommentDao,
wrapper.eq(BookForumCommentEntity::getDelflag,0);
wrapper.orderByAsc(BookForumCommentEntity::getCreateTime);
List<BookForumCommentEntity> bookForumCommentEntities = this.getBaseMapper().selectList(wrapper);
for (BookForumCommentEntity b:bookForumCommentEntities){
b.setUser(userService.getById(b.getUserid()));
b.setPuser(userService.getById(b.getPuserid()));
}
return bookForumCommentEntities;
}
@Override
public Integer getCommentCountInComment(Integer comment_id) {
LambdaQueryWrapper<BookForumCommentEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BookForumCommentEntity::getPid,comment_id);
wrapper.eq(BookForumCommentEntity::getDelflag,0);
Integer integer = this.getBaseMapper().selectCount(wrapper);
return integer;
}
}