init
This commit is contained in:
@@ -1,12 +1,19 @@
|
|||||||
package com.ruoyi.test.business;
|
package com.ruoyi.test.business;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.test.RefreshArea;
|
import com.ruoyi.test.RefreshArea;
|
||||||
|
import com.ruoyi.xq.domain.User;
|
||||||
import com.ruoyi.xq.job.JobManager;
|
import com.ruoyi.xq.job.JobManager;
|
||||||
|
import com.ruoyi.xq.service.UserService;
|
||||||
|
import com.ruoyi.xq.util.AgeUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RefreshTest {
|
public class RefreshTest {
|
||||||
@@ -14,6 +21,8 @@ public class RefreshTest {
|
|||||||
private RefreshArea refreshArea;
|
private RefreshArea refreshArea;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JobManager jobManager;
|
private JobManager jobManager;
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void refresh(){
|
public void refresh(){
|
||||||
@@ -24,4 +33,24 @@ public class RefreshTest {
|
|||||||
public void updateAge(){
|
public void updateAge(){
|
||||||
jobManager.updateAge();
|
jobManager.updateAge();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void checkBaseStatus(){
|
||||||
|
int current = 0;
|
||||||
|
while (true){
|
||||||
|
current++;
|
||||||
|
IPage<User> page = new Page<>();
|
||||||
|
page.setCurrent(current);
|
||||||
|
page.setSize(100);
|
||||||
|
IPage<User> userPage = userService.page(page);
|
||||||
|
List<User> records = userPage.getRecords();
|
||||||
|
if(records.isEmpty()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for (User record : records) {
|
||||||
|
userService.checkFinishStatus(record.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user