fix:白名单随机

上级 5acb362a
...@@ -3,6 +3,7 @@ package com.kwan.springbootkwan.service.impl; ...@@ -3,6 +3,7 @@ package com.kwan.springbootkwan.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.kwan.springbootkwan.entity.CsdnUserInfo; import com.kwan.springbootkwan.entity.CsdnUserInfo;
...@@ -104,10 +105,14 @@ public class CsdnServiceImpl implements CsdnService { ...@@ -104,10 +105,14 @@ public class CsdnServiceImpl implements CsdnService {
@Override @Override
public void multiTriplet() { public void multiTriplet() {
final List<CsdnUserInfo> list = csdnUserInfoService.list(); QueryWrapper<CsdnUserInfo> wrapper = new QueryWrapper<>();
wrapper.eq("is_delete", 0);
wrapper.orderByAsc("rand()");
final List<CsdnUserInfo> list = csdnUserInfoService.list(wrapper);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
for (CsdnUserInfo csdnUserInfo : list) { for (CsdnUserInfo csdnUserInfo : list) {
singleArticle(csdnUserInfo.getUserName()); final String userName = csdnUserInfo.getUserName();
singleArticle(userName);
} }
} }
log.info("全部三连完成"); log.info("全部三连完成");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册