fix:添加多查询条件

上级 f2ee01ec
......@@ -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<CsdnUserInfo> 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
......@@ -33,6 +33,10 @@ public class CsdnUserInfoQuery extends BasePage {
* 用户权重
*/
private Integer userWeight;
/**
* 文章类型
*/
private String articleType;
/**
* 添加类型
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册