From 60b4ecf5e6d1177adbc6f031953e13c7abcfa79d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Tue, 24 Oct 2023 21:31:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=99=BD=E5=90=8D=E5=8D=95=E9=9A=8F?= =?UTF-8?q?=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springbootkwan/service/impl/CsdnServiceImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java index 85ee567..58d31fd 100644 --- a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java +++ b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnServiceImpl.java @@ -3,6 +3,7 @@ package com.kwan.springbootkwan.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.kwan.springbootkwan.entity.CsdnUserInfo; @@ -104,10 +105,14 @@ public class CsdnServiceImpl implements CsdnService { @Override public void multiTriplet() { - final List list = csdnUserInfoService.list(); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_delete", 0); + wrapper.orderByAsc("rand()"); + final List list = csdnUserInfoService.list(wrapper); if (CollectionUtil.isNotEmpty(list)) { for (CsdnUserInfo csdnUserInfo : list) { - singleArticle(csdnUserInfo.getUserName()); + final String userName = csdnUserInfo.getUserName(); + singleArticle(userName); } } log.info("全部三连完成"); -- GitLab