123333
This commit is contained in:
@@ -18,6 +18,7 @@ import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -93,6 +94,9 @@ public class HomeManager {
|
||||
Collections.shuffle(vos);
|
||||
Integer pageNum = pageQuery.getPageNum();
|
||||
int startIndex = (pageNum - 1) * pageQuery.getPageSize();
|
||||
if(startIndex > vos.size()){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int endIndex = Math.min(startIndex+pageQuery.getPageSize(), vos.size());
|
||||
return vos.subList(startIndex, endIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user