diff --git a/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java b/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java index b3aefbd95a738b44f9d0cdfc0eb7b51d3b63b667..59e19bb19f3cc86485a86bca39bcf4c64da25701 100644 --- a/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java +++ b/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java @@ -24,8 +24,6 @@ import java.util.Objects; @RestController @RequestMapping("/csdn/user") public class CsdnUserController { - - @Autowired private CsdnUserInfoService csdnUserInfoService; @@ -39,6 +37,10 @@ public class CsdnUserController { final Integer userWeight = query.getUserWeight(); final String nickName = query.getNickName(); final String userName = query.getUserName(); + final String articleType = query.getArticleType(); + final Integer likeStatus = query.getLikeStatus(); + final Integer collectStatus = query.getCollectStatus(); + final Integer commentStatus = query.getCommentStatus(); Page pageParm = new Page<>(); pageParm.setCurrent(query.getPage()); pageParm.setSize(query.getPageSize()); @@ -48,9 +50,21 @@ public class CsdnUserController { if (StringUtils.isNotEmpty(userName)) { wrapper.eq("user_name", userName); } + if (StringUtils.isNotEmpty(articleType)) { + wrapper.eq("article_type", articleType); + } if (Objects.nonNull(userWeight)) { wrapper.eq("user_weight", userWeight); } + if (Objects.nonNull(likeStatus)) { + wrapper.eq("like_status", likeStatus); + } + if (Objects.nonNull(collectStatus)) { + wrapper.eq("collect_status", collectStatus); + } + if (Objects.nonNull(commentStatus)) { + wrapper.eq("comment_status", commentStatus); + } if (StringUtils.isNotEmpty(nickName)) { wrapper.like("nick_name", nickName); } @@ -135,5 +149,4 @@ public class CsdnUserController { wrapper.eq("id", id); return Result.ok(this.csdnUserInfoService.update(csdnUserInfo, wrapper)); } - -} +} \ No newline at end of file diff --git a/src/main/java/com/kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java b/src/main/java/com/kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java index b806b6a94cfe21d8ca98529e01667be1cf44b266..0dd9ba3cce6119bd24efe468d106dc975f85be8a 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java +++ b/src/main/java/com/kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java @@ -33,6 +33,10 @@ public class CsdnUserInfoQuery extends BasePage { * 用户权重 */ private Integer userWeight; + /** + * 文章类型 + */ + private String articleType; /** * 添加类型 */