This commit is contained in:
77
2024-04-21 23:16:10 +08:00
parent 06770fb1b9
commit f98f1be3d5
15 changed files with 92 additions and 7 deletions

View File

@@ -70,6 +70,7 @@ public class HomeManager {
AnchorListQuery query = new AnchorListQuery();
// 0-默认查询 1-活跃查询 2-新人查询 3-同城查询
query.setType(1);
query.setOnlineStatus(1);
query.setOpenVideoStatus(1);
Page<AnchorListVo> app = anchorService.pageApp(pageQuery, query);
List<AnchorListVo> records = app.getRecords();
@@ -84,6 +85,7 @@ public class HomeManager {
AnchorListQuery query = new AnchorListQuery();
// 0-默认查询 1-活跃查询 2-新人查询 3-同城查询
query.setType(2);
query.setOnlineStatus(1);
query.setOpenVideoStatus(1);
Page<AnchorListVo> app = anchorService.pageApp(pageQuery, query);
List<AnchorListVo> records = app.getRecords();
@@ -122,6 +124,8 @@ public class HomeManager {
List<AnchorListVo> result = vos.subList(startIndex, endIndex);
if(anchorListQueryTypeEnum == AnchorListQueryTypeEnum.DEFAULT && pageNum == 1){
List<AnchorListVo> list = getAnchorTopList();
Collections.shuffle(list);
list = list.subList(0,Math.min(4,list.size()));
if(CollectionUtils.isNotEmpty(list)){
List<Long> topUserIds = list.stream().map(AnchorListVo::getUserId).collect(Collectors.toList());
result = result.stream().filter(anchorListVo -> !topUserIds.contains(anchorListVo.getUserId())).collect(Collectors.toList());