Commit d32d449c by 段启岩

2020.2.1第一次合并

parent 435834d9
...@@ -28,7 +28,7 @@ public class BlogCommentApi { ...@@ -28,7 +28,7 @@ public class BlogCommentApi {
this.blogCommentService = blogCommentService; this.blogCommentService = blogCommentService;
} }
@ApiOperation("创建评论") @ApiOperation("发表评论")
@PostMapping("/blog/{blogId}/comment") @PostMapping("/blog/{blogId}/comment")
public Response createComment (@PathVariable("blogId") String blogId, @RequestBody @Valid BlogCommentForm blogCommentForm, @CurrentSubject Subject subject){ public Response createComment (@PathVariable("blogId") String blogId, @RequestBody @Valid BlogCommentForm blogCommentForm, @CurrentSubject Subject subject){
......
...@@ -3,14 +3,11 @@ package cn.meteor.beyondclouds.modules.blog.service.impl; ...@@ -3,14 +3,11 @@ package cn.meteor.beyondclouds.modules.blog.service.impl;
import cn.meteor.beyondclouds.modules.blog.entity.Blog; import cn.meteor.beyondclouds.modules.blog.entity.Blog;
import cn.meteor.beyondclouds.modules.blog.entity.BlogComment; import cn.meteor.beyondclouds.modules.blog.entity.BlogComment;
import cn.meteor.beyondclouds.modules.blog.enums.BlogCommentErrorCode; import cn.meteor.beyondclouds.modules.blog.enums.BlogCommentErrorCode;
import cn.meteor.beyondclouds.modules.blog.enums.BlogErrorCode;
import cn.meteor.beyondclouds.modules.blog.exception.BlogCommentServiceException; import cn.meteor.beyondclouds.modules.blog.exception.BlogCommentServiceException;
import cn.meteor.beyondclouds.modules.blog.mapper.BlogCommentMapper; import cn.meteor.beyondclouds.modules.blog.mapper.BlogCommentMapper;
import cn.meteor.beyondclouds.modules.blog.service.IBlogCommentService; import cn.meteor.beyondclouds.modules.blog.service.IBlogCommentService;
import cn.meteor.beyondclouds.modules.blog.service.IBlogService; import cn.meteor.beyondclouds.modules.blog.service.IBlogService;
import cn.meteor.beyondclouds.modules.project.entity.ProjectComment;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -43,14 +40,14 @@ public class BlogCommentServiceImpl extends ServiceImpl<BlogCommentMapper, BlogC ...@@ -43,14 +40,14 @@ public class BlogCommentServiceImpl extends ServiceImpl<BlogCommentMapper, BlogC
int depth; int depth;
//1.判断为第几级评论 //1.判断为第几级评论
if(parentId == null){ if (parentId == null) {
depth = 0; depth = 0;
}else { } else {
QueryWrapper<BlogComment> queryWrapper = new QueryWrapper<>(); QueryWrapper<BlogComment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("comment_id", parentId); queryWrapper.eq("comment_id", parentId);
BlogComment blogCommentParent = getOne(queryWrapper); BlogComment blogCommentParent = getOne(queryWrapper);
depth = blogCommentParent.getDepth()+1; depth = blogCommentParent.getDepth() + 1;
} }
//2.创建评论 //2.创建评论
...@@ -62,14 +59,14 @@ public class BlogCommentServiceImpl extends ServiceImpl<BlogCommentMapper, BlogC ...@@ -62,14 +59,14 @@ public class BlogCommentServiceImpl extends ServiceImpl<BlogCommentMapper, BlogC
blogComment.setUserId(userId); blogComment.setUserId(userId);
save(blogComment); save(blogComment);
//3.查找上一层目录 //3.查找上一层目录
if(blogComment.getParentId() == null) { if (blogComment.getParentId() == null) {
thread = "/"+ blogComment.getCommentId(); thread = "/" + blogComment.getCommentId();
}else { } else {
QueryWrapper<BlogComment> queryWrapper = new QueryWrapper<>(); QueryWrapper<BlogComment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("comment_id", blogComment.getParentId()); queryWrapper.eq("comment_id", blogComment.getParentId());
//重新创建对象 存储上一级目录 //重新创建对象 存储上一级目录
BlogComment blogCommentPatent = getOne(queryWrapper); BlogComment blogCommentPatent = getOne(queryWrapper);
thread = blogCommentPatent.getThread()+"/"+blogComment.getCommentId(); thread = blogCommentPatent.getThread() + "/" + blogComment.getCommentId();
} }
blogComment.setThread(thread); blogComment.setThread(thread);
//4.更新路径信息 //4.更新路径信息
...@@ -78,7 +75,6 @@ public class BlogCommentServiceImpl extends ServiceImpl<BlogCommentMapper, BlogC ...@@ -78,7 +75,6 @@ public class BlogCommentServiceImpl extends ServiceImpl<BlogCommentMapper, BlogC
} }
@Override @Override
public void deleteComment(Integer commentId, String userId) throws BlogCommentServiceException { public void deleteComment(Integer commentId, String userId) throws BlogCommentServiceException {
Assert.notNull(commentId, "commentId must not be null"); Assert.notNull(commentId, "commentId must not be null");
......
...@@ -15,8 +15,8 @@ import cn.meteor.beyondclouds.modules.question.service.IQuestionService; ...@@ -15,8 +15,8 @@ import cn.meteor.beyondclouds.modules.question.service.IQuestionService;
import cn.meteor.beyondclouds.modules.question.service.IQuestionTagService; import cn.meteor.beyondclouds.modules.question.service.IQuestionTagService;
import cn.meteor.beyondclouds.modules.question.util.QuestionUtils; import cn.meteor.beyondclouds.modules.question.util.QuestionUtils;
import cn.meteor.beyondclouds.modules.question.vo.PageVO; import cn.meteor.beyondclouds.modules.question.vo.PageVO;
import cn.meteor.beyondclouds.modules.tag.entity.Tag;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
/** /**
* @author 胡学良 * @author 胡学良
...@@ -165,9 +166,9 @@ public class QuestionApi { ...@@ -165,9 +166,9 @@ public class QuestionApi {
@Anonymous @Anonymous
@ApiOperation(("得到问题的引用标签")) @ApiOperation(("得到问题的引用标签"))
@GetMapping("/question/{questionId}/tags") @GetMapping("/question/{questionId}/tags")
public Response<String> questionTags(@PathVariable("questionId") String questionId) { public Response<List<Tag>> questionTags(@PathVariable("questionId") String questionId) {
try { try {
String tags = questionTagService.getQuestionTags(questionId); List<Tag> tags = questionTagService.getQuestionTags(questionId);
return Response.success(tags); return Response.success(tags);
} catch (QuestionTagServiceException e) { } catch (QuestionTagServiceException e) {
e.printStackTrace(); e.printStackTrace();
......
package cn.meteor.beyondclouds.modules.question.bean; package cn.meteor.beyondclouds.modules.question.bean;
import cn.meteor.beyondclouds.modules.question.entity.Question; import cn.meteor.beyondclouds.modules.question.entity.Question;
import cn.meteor.beyondclouds.modules.tag.entity.Tag;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author 胡学良 * @author 胡学良
* @since 2020/1/31 * @since 2020/1/31
...@@ -20,6 +23,6 @@ public class QuestionDetails extends Question { ...@@ -20,6 +23,6 @@ public class QuestionDetails extends Question {
private String questionDetail; private String questionDetail;
@ApiModelProperty("标签") @ApiModelProperty("标签")
private String tags; private List<Tag> tags;
} }
package cn.meteor.beyondclouds.modules.question.service; package cn.meteor.beyondclouds.modules.question.service;
import cn.meteor.beyondclouds.modules.question.entity.QuestionTag; import cn.meteor.beyondclouds.modules.question.entity.QuestionTag;
import cn.meteor.beyondclouds.modules.question.exception.QuestionServiceException;
import cn.meteor.beyondclouds.modules.question.exception.QuestionTagServiceException; import cn.meteor.beyondclouds.modules.question.exception.QuestionTagServiceException;
import cn.meteor.beyondclouds.modules.tag.entity.Tag;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
/** /**
* <p> * <p>
...@@ -31,5 +32,5 @@ public interface IQuestionTagService extends IService<QuestionTag> { ...@@ -31,5 +32,5 @@ public interface IQuestionTagService extends IService<QuestionTag> {
* @return 问题引用标签 * @return 问题引用标签
* @throws QuestionTagServiceException 问题业务异常 * @throws QuestionTagServiceException 问题业务异常
*/ */
String getQuestionTags(String questionId) throws QuestionTagServiceException; List<Tag> getQuestionTags(String questionId) throws QuestionTagServiceException;
} }
package cn.meteor.beyondclouds.modules.question.service.impl; package cn.meteor.beyondclouds.modules.question.service.impl;
import cn.meteor.beyondclouds.modules.question.bean.QuestionDetails; import cn.meteor.beyondclouds.modules.question.bean.QuestionDetails;
import cn.meteor.beyondclouds.modules.question.entity.*; import cn.meteor.beyondclouds.modules.question.entity.Question;
import cn.meteor.beyondclouds.modules.question.entity.QuestionCategory;
import cn.meteor.beyondclouds.modules.question.entity.QuestionExt;
import cn.meteor.beyondclouds.modules.question.entity.QuestionReply;
import cn.meteor.beyondclouds.modules.question.enums.QuestionErrorCode; import cn.meteor.beyondclouds.modules.question.enums.QuestionErrorCode;
import cn.meteor.beyondclouds.modules.question.exception.QuestionServiceException; import cn.meteor.beyondclouds.modules.question.exception.QuestionServiceException;
import cn.meteor.beyondclouds.modules.question.exception.QuestionTagServiceException; import cn.meteor.beyondclouds.modules.question.exception.QuestionTagServiceException;
import cn.meteor.beyondclouds.modules.question.mapper.QuestionMapper; import cn.meteor.beyondclouds.modules.question.mapper.QuestionMapper;
import cn.meteor.beyondclouds.modules.question.service.*; import cn.meteor.beyondclouds.modules.question.service.*;
import cn.meteor.beyondclouds.modules.question.util.QuestionUtils; import cn.meteor.beyondclouds.modules.question.util.QuestionUtils;
import cn.meteor.beyondclouds.modules.tag.service.ITagService; import cn.meteor.beyondclouds.modules.tag.entity.Tag;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -180,7 +183,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i ...@@ -180,7 +183,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
QuestionExt questionExt = questionExtService.getOne(QuestionUtils.getWrapper("question_id", questionId)); QuestionExt questionExt = questionExtService.getOne(QuestionUtils.getWrapper("question_id", questionId));
//4.获取问题标签 //4.获取问题标签
String tags = questionTagService.getQuestionTags(questionId); List<Tag> tags = questionTagService.getQuestionTags(questionId);
//5.生成问题详情对象 //5.生成问题详情对象
QuestionDetails questionDetails = new QuestionDetails(); QuestionDetails questionDetails = new QuestionDetails();
......
...@@ -3,7 +3,6 @@ package cn.meteor.beyondclouds.modules.question.service.impl; ...@@ -3,7 +3,6 @@ package cn.meteor.beyondclouds.modules.question.service.impl;
import cn.meteor.beyondclouds.modules.question.entity.Question; import cn.meteor.beyondclouds.modules.question.entity.Question;
import cn.meteor.beyondclouds.modules.question.entity.QuestionTag; import cn.meteor.beyondclouds.modules.question.entity.QuestionTag;
import cn.meteor.beyondclouds.modules.question.enums.QuestionErrorCode; import cn.meteor.beyondclouds.modules.question.enums.QuestionErrorCode;
import cn.meteor.beyondclouds.modules.question.exception.QuestionServiceException;
import cn.meteor.beyondclouds.modules.question.exception.QuestionTagServiceException; import cn.meteor.beyondclouds.modules.question.exception.QuestionTagServiceException;
import cn.meteor.beyondclouds.modules.question.mapper.QuestionTagMapper; import cn.meteor.beyondclouds.modules.question.mapper.QuestionTagMapper;
import cn.meteor.beyondclouds.modules.question.service.IQuestionService; import cn.meteor.beyondclouds.modules.question.service.IQuestionService;
...@@ -18,6 +17,7 @@ import org.springframework.stereotype.Service; ...@@ -18,6 +17,7 @@ import org.springframework.stereotype.Service;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
...@@ -61,7 +61,7 @@ public class QuestionTagServiceImpl extends ServiceImpl<QuestionTagMapper, Quest ...@@ -61,7 +61,7 @@ public class QuestionTagServiceImpl extends ServiceImpl<QuestionTagMapper, Quest
} }
@Override @Override
public String getQuestionTags(String questionId) throws QuestionTagServiceException { public List<Tag> getQuestionTags(String questionId) throws QuestionTagServiceException {
//1.获取问题信息 //1.获取问题信息
Question question = questionService.getById(questionId); Question question = questionService.getById(questionId);
...@@ -70,15 +70,13 @@ public class QuestionTagServiceImpl extends ServiceImpl<QuestionTagMapper, Quest ...@@ -70,15 +70,13 @@ public class QuestionTagServiceImpl extends ServiceImpl<QuestionTagMapper, Quest
throw new QuestionTagServiceException(QuestionErrorCode.QUESTION_NOT_FOUND); throw new QuestionTagServiceException(QuestionErrorCode.QUESTION_NOT_FOUND);
} }
//2.得到问题引用标签 //2.得到问题引用的所有标签的ID
List<QuestionTag> questionTags = list(QuestionUtils.getWrapper("question_id", questionId)); List<QuestionTag> questionTags = list(QuestionUtils.getWrapper("question_id", questionId));
StringBuilder stringBuilder = new StringBuilder(); List<String> tagIds = questionTags.stream()
stringBuilder.append("["); .map(QuestionTag::getTagId)
for (QuestionTag questionTag : questionTags){ .collect(Collectors.toList());
stringBuilder.append(tagService.getById(questionTag.getTagId()).getTagName()+",");
} // 3.根据tagIds查询出标签并返回
stringBuilder.deleteCharAt(stringBuilder.length()-1); return tagService.listByIds(tagIds);
stringBuilder.append("]");
return stringBuilder.toString();
} }
} }
...@@ -139,7 +139,7 @@ public class UserApi { ...@@ -139,7 +139,7 @@ public class UserApi {
@PostMapping("/my/blacklist/{userId}") @PostMapping("/my/blacklist/{userId}")
public Response blacklist(@PathVariable(name = "userId") String userId, @CurrentSubject Subject subject){ public Response blacklist(@PathVariable(name = "userId") String userId, @CurrentSubject Subject subject){
userBlacklistService.blacklist(userId,String.valueOf(subject.getId())); userBlacklistService.blacklist(userId, (String) subject.getId());
return Response.success(); return Response.success();
} }
...@@ -148,7 +148,7 @@ public class UserApi { ...@@ -148,7 +148,7 @@ public class UserApi {
@PostMapping("/user/{userId}/follower") @PostMapping("/user/{userId}/follower")
public Response follower(@PathVariable(name = "userId") String userId, @CurrentSubject Subject subject){ public Response follower(@PathVariable(name = "userId") String userId, @CurrentSubject Subject subject){
userFollowService.follower(userId, String.valueOf(subject.getId())); userFollowService.follow(userId, (String) subject.getId());
return Response.success(); return Response.success();
} }
...@@ -157,7 +157,7 @@ public class UserApi { ...@@ -157,7 +157,7 @@ public class UserApi {
@DeleteMapping("/user/{userId}/follower") @DeleteMapping("/user/{userId}/follower")
public Response delFollower(@PathVariable(name = "userId") String userId, @CurrentSubject Subject subject){ public Response delFollower(@PathVariable(name = "userId") String userId, @CurrentSubject Subject subject){
userFollowService.delFollower(userId, String.valueOf(subject.getId())); userFollowService.delFollow(userId, String.valueOf(subject.getId()));
return Response.success(); return Response.success();
} }
...@@ -167,7 +167,7 @@ public class UserApi { ...@@ -167,7 +167,7 @@ public class UserApi {
public Response myFans(@Valid PageForm pageForm, @CurrentSubject Subject subject){ public Response myFans(@Valid PageForm pageForm, @CurrentSubject Subject subject){
// 根据userId获取粉丝并返回 // 根据userId获取粉丝并返回
IPage<UserFollow> fansPage = userFollowService.getFansPage(pageForm.getPage(), pageForm.getSize(), String.valueOf(subject.getId())); IPage<UserFollow> fansPage = userFollowService.getFansPage(pageForm.getPage(), pageForm.getSize(), (String) subject.getId());
PageVO<UserFollow> fansPageVo = new PageVO<>(); PageVO<UserFollow> fansPageVo = new PageVO<>();
fansPageVo.setTotalPage(fansPage.getPages()); fansPageVo.setTotalPage(fansPage.getPages());
fansPageVo.setDataList(fansPage.getRecords()); fansPageVo.setDataList(fansPage.getRecords());
......
...@@ -15,8 +15,8 @@ public interface IUserBlacklistService extends IService<UserBlacklist> { ...@@ -15,8 +15,8 @@ public interface IUserBlacklistService extends IService<UserBlacklist> {
/** /**
* 拉黑 * 拉黑
* @param blackId * @param blackeId
* @param userId * @param userId
*/ */
void blacklist(String blackId, String userId); void blacklist(String blackeId, String userId);
} }
...@@ -14,18 +14,18 @@ public interface IUserFollowService extends IService<UserFollow> { ...@@ -14,18 +14,18 @@ public interface IUserFollowService extends IService<UserFollow> {
/** /**
* 关注 * 关注
* @param userId * @param followedId 关注者的ID
* @param myUserId * @param followerId 被关注者的ID
*/ */
void follower(String userId, String myUserId); void follow(String followedId, String followerId);
/** /**
* 取消关注 * 取消关注
* @param userId * @param followedId
* @param myUserId * @param followerId
*/ */
void delFollower(String userId, String myUserId); void delFollow(String followedId, String followerId);
......
...@@ -19,13 +19,13 @@ public class UserBlacklistServiceImpl extends ServiceImpl<UserBlacklistMapper, U ...@@ -19,13 +19,13 @@ public class UserBlacklistServiceImpl extends ServiceImpl<UserBlacklistMapper, U
/** /**
* 拉黑 * 拉黑
* @param blackId 拉黑用户的id * @param blackedId 被拉黑用户的id
* @param userId * @param userId
*/ */
@Override @Override
public void blacklist(String blackId, String userId) { public void blacklist(String blackedId, String userId) {
UserBlacklist userBlacklist = new UserBlacklist(); UserBlacklist userBlacklist = new UserBlacklist();
userBlacklist.setBlackedId(blackId); userBlacklist.setBlackedId(blackedId);
userBlacklist.setUserId(userId); userBlacklist.setUserId(userId);
save(userBlacklist); save(userBlacklist);
} }
......
...@@ -30,25 +30,25 @@ public class UserFollowServiceImpl extends ServiceImpl<IUserFollowMapper, UserFo ...@@ -30,25 +30,25 @@ public class UserFollowServiceImpl extends ServiceImpl<IUserFollowMapper, UserFo
/** /**
* 关注 * 关注
* @param userId 被关注用户的userId * @param followedId 被关注用户的userId
* @param myUserId 当前用户的userId * @param followerId 关注者的userId
*/ */
@Override @Override
public void follower(String userId, String myUserId) { public void follow(String followedId, String followerId) {
UserFollow userFollow = new UserFollow(); UserFollow userFollow = new UserFollow();
//1.查询被关注用户的基本信息 //1.查询被关注用户的基本信息
User user = userService.getById(userId); User followedUser = userService.getById(followedId);
userFollow.setFollowedId(userId); userFollow.setFollowedId(followedId);
userFollow.setFollowedNick(user.getNickName()); userFollow.setFollowedNick(followedUser.getNickName());
userFollow.setFollowedAvatar(user.getUserAvatar()); userFollow.setFollowedAvatar(followedUser.getUserAvatar());
//2.查询我的基本信息 //2.查询我的基本信息
User myUser = userService.getById(myUserId); User followerUser = userService.getById(followerId);
userFollow.setFollowerId(myUserId); userFollow.setFollowerId(followerId);
userFollow.setFollowerNick(myUser.getNickName()); userFollow.setFollowerNick(followerUser.getNickName());
userFollow.setFollowerAvatar(myUser.getUserAvatar()); userFollow.setFollowerAvatar(followerUser.getUserAvatar());
userFollow.setFollowStatus(0); userFollow.setFollowStatus(0);
save(userFollow); save(userFollow);
...@@ -57,19 +57,19 @@ public class UserFollowServiceImpl extends ServiceImpl<IUserFollowMapper, UserFo ...@@ -57,19 +57,19 @@ public class UserFollowServiceImpl extends ServiceImpl<IUserFollowMapper, UserFo
/** /**
* 取消关注 * 取消关注
* @param userId 被关注用户的userId * @param followedId 被关注用户的userId
* @param myUserId 当前用户的userId * @param followerId 关注者户的userId
*/ */
@Override @Override
public void delFollower(String userId, String myUserId) { public void delFollow(String followedId, String followerId) {
//1.查找符合条件的关注信息 //1.查找符合条件的关注信息
UpdateWrapper updateWrapper = new UpdateWrapper(); UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.eq("follower_id", myUserId); updateWrapper.eq("followed_id", followedId);
updateWrapper.eq("followed_id", userId); updateWrapper.eq("follower_id", followerId);
//2.将关注状态设置为-1并保存 //2.将关注状态设置为-1并保存
updateWrapper.set("follow_status",-1); updateWrapper.set("follow_status", -1);
update(updateWrapper); update(updateWrapper);
} }
...@@ -83,9 +83,9 @@ public class UserFollowServiceImpl extends ServiceImpl<IUserFollowMapper, UserFo ...@@ -83,9 +83,9 @@ public class UserFollowServiceImpl extends ServiceImpl<IUserFollowMapper, UserFo
@Override @Override
public IPage<UserFollow> getFansPage(Integer pageNumber, Integer pageSize, String userId) { public IPage<UserFollow> getFansPage(Integer pageNumber, Integer pageSize, String userId) {
IPage<UserFollow> page = new Page<>(pageNumber, pageSize); IPage<UserFollow> page = new Page<>(pageNumber, pageSize);
QueryWrapper<UserFollow> projectQueryWrapper = new QueryWrapper<>(); QueryWrapper<UserFollow> userFollowQueryWrapper = new QueryWrapper<>();
projectQueryWrapper.eq("followed_id", userId); userFollowQueryWrapper.eq("followed_id", userId);
return page(page, projectQueryWrapper); return page(page, userFollowQueryWrapper);
} }
/** /**
...@@ -98,9 +98,9 @@ public class UserFollowServiceImpl extends ServiceImpl<IUserFollowMapper, UserFo ...@@ -98,9 +98,9 @@ public class UserFollowServiceImpl extends ServiceImpl<IUserFollowMapper, UserFo
@Override @Override
public IPage<UserFollow> getFollowersPage(Integer pageNumber, Integer pageSize, String userId) { public IPage<UserFollow> getFollowersPage(Integer pageNumber, Integer pageSize, String userId) {
IPage<UserFollow> page = new Page<>(pageNumber, pageSize); IPage<UserFollow> page = new Page<>(pageNumber, pageSize);
QueryWrapper<UserFollow> projectQueryWrapper = new QueryWrapper<>(); QueryWrapper<UserFollow> userFollowQueryWrapper = new QueryWrapper<>();
projectQueryWrapper.eq("follower_id", userId); userFollowQueryWrapper.eq("follower_id", userId);
return page(page, projectQueryWrapper); return page(page, userFollowQueryWrapper);
} }
} }
......
...@@ -3,7 +3,7 @@ spring: ...@@ -3,7 +3,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/beyond_clouds?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true url: jdbc:mysql://127.0.0.1:3306/beyond_clouds?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: 197442 password: 100Centa30821%mysql
swagger: swagger:
enable: true enable: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment