userentity bug
This commit is contained in:
@@ -13,8 +13,6 @@ public interface BookForumArticlesService extends IService<BookForumArticlesEn
|
||||
PageUtils queryPages(Map<String, Object> params);
|
||||
|
||||
|
||||
List<BookForumArticlesEntity> getForumsLimit(Integer book_id,Integer limit);
|
||||
|
||||
Integer getForumsCount(Integer book_id);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.peanut.modules.book.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookForumArticlesEntity;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.book.entity.UserAppAuthorEntity;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -30,6 +32,8 @@ public interface MyUserService extends IService<MyUserEntity> {
|
||||
//电子书针对听书鉴权
|
||||
boolean bookAuthen(Integer bookId,Integer userId);
|
||||
|
||||
List<BookForumArticlesEntity> getForumsLimit(Integer book_id, Integer limit);
|
||||
|
||||
|
||||
//会员开通 电话 开通 期限
|
||||
boolean openMember(Integer customerId,Integer openMonth);
|
||||
|
||||
@@ -6,28 +6,20 @@ 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.service.UserService;
|
||||
import com.peanut.modules.book.dao.BookForumArticlesDao;
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.book.entity.BookForumArticlesEntity;
|
||||
import com.peanut.modules.book.entity.PublisherEntity;
|
||||
import com.peanut.modules.book.service.AuthorService;
|
||||
import com.peanut.modules.book.service.BookForumArticlesService;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import com.peanut.modules.book.service.PublisherService;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class BookForumArticlesServiceImpl extends ServiceImpl<BookForumArticlesDao, BookForumArticlesEntity> implements BookForumArticlesService {
|
||||
|
||||
@Autowired
|
||||
UserService userService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@@ -61,20 +53,6 @@ public class BookForumArticlesServiceImpl extends ServiceImpl<BookForumArticlesD
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookForumArticlesEntity> getForumsLimit(Integer book_id,Integer limit) {
|
||||
LambdaQueryWrapper<BookForumArticlesEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookForumArticlesEntity::getDelflag,0);
|
||||
wrapper.eq(BookForumArticlesEntity::getBookid,book_id);
|
||||
wrapper.orderByDesc(BookForumArticlesEntity::getCreateTime);
|
||||
wrapper.last("limit "+limit);
|
||||
List<BookForumArticlesEntity> bookForumArticlesEntities = this.getBaseMapper().selectList(wrapper);
|
||||
//补充说话的人的用户信息
|
||||
for (BookForumArticlesEntity b : bookForumArticlesEntities){
|
||||
b.setUser(userService.getById(b.getUserid()));
|
||||
}
|
||||
return bookForumArticlesEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getForumsCount(Integer book_id) {
|
||||
|
||||
@@ -6,10 +6,10 @@ 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.service.UserService;
|
||||
import com.peanut.modules.book.dao.BookForumCommentDao;
|
||||
import com.peanut.modules.book.entity.BookForumCommentEntity;
|
||||
import com.peanut.modules.book.service.BookForumCommenService;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Map;
|
||||
public class BookForumCommenServiceImpl extends ServiceImpl<BookForumCommentDao, BookForumCommentEntity> implements BookForumCommenService {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
private MyUserService userService;
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody;
|
||||
import com.aliyun.tea.TeaException;
|
||||
import com.aliyun.teautil.Common;
|
||||
import com.aliyun.teautil.models.RuntimeOptions;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.peanut.common.utils.*;
|
||||
@@ -55,6 +56,8 @@ public class MyUserServiceImpl extends ServiceImpl<MyUserDao, MyUserEntity> impl
|
||||
private CouponHistoryService couponHistoryService;
|
||||
@Autowired
|
||||
private MyUserDao myUserDao;
|
||||
@Autowired
|
||||
private BookForumArticlesService bookForumArticlesService;
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
@@ -145,6 +148,21 @@ public class MyUserServiceImpl extends ServiceImpl<MyUserDao, MyUserEntity> impl
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookForumArticlesEntity> getForumsLimit(Integer book_id,Integer limit) {
|
||||
LambdaQueryWrapper<BookForumArticlesEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookForumArticlesEntity::getDelflag,0);
|
||||
wrapper.eq(BookForumArticlesEntity::getBookid,book_id);
|
||||
wrapper.orderByDesc(BookForumArticlesEntity::getCreateTime);
|
||||
wrapper.last("limit "+limit);
|
||||
List<BookForumArticlesEntity> bookForumArticlesEntities = bookForumArticlesService.getBaseMapper().selectList(wrapper);
|
||||
//补充说话的人的用户信息
|
||||
for (BookForumArticlesEntity b : bookForumArticlesEntities){
|
||||
b.setUser(this.getById(b.getUserid()));
|
||||
}
|
||||
return bookForumArticlesEntities;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user