This commit is contained in:
77
2024-04-17 23:28:20 +08:00
parent afa34b6c0c
commit 4fec751dd7
3 changed files with 14 additions and 0 deletions

View File

@@ -18,6 +18,9 @@ public class AnchorListQuery {
@Schema(description = "类型 0-默认 1-活跃 2-新人 3-同城") @Schema(description = "类型 0-默认 1-活跃 2-新人 3-同城")
private Integer type; private Integer type;
@Schema(hidden = true, description = "是否开启视频接听")
private Integer openVideoStatus;
@Schema(description = "城市(同城查询使用)") @Schema(description = "城市(同城查询使用)")
private Integer cityId; private Integer cityId;

View File

@@ -56,6 +56,7 @@ public class HomeManager {
// 0-默认查询 1-活跃查询 2-新人查询 3-同城查询 // 0-默认查询 1-活跃查询 2-新人查询 3-同城查询
query.setType(0); query.setType(0);
query.setOnlineStatus(1); query.setOnlineStatus(1);
query.setOpenVideoStatus(1);
Page<AnchorListVo> app = anchorService.pageApp(pageQuery, query); Page<AnchorListVo> app = anchorService.pageApp(pageQuery, query);
List<AnchorListVo> records = app.getRecords(); List<AnchorListVo> records = app.getRecords();
RBucket<List<AnchorListVo>> bucket = redissonClient.getBucket(RedisHttpConstant.HOME_RECOMMEND_REDIS); RBucket<List<AnchorListVo>> bucket = redissonClient.getBucket(RedisHttpConstant.HOME_RECOMMEND_REDIS);
@@ -69,6 +70,7 @@ public class HomeManager {
AnchorListQuery query = new AnchorListQuery(); AnchorListQuery query = new AnchorListQuery();
// 0-默认查询 1-活跃查询 2-新人查询 3-同城查询 // 0-默认查询 1-活跃查询 2-新人查询 3-同城查询
query.setType(1); query.setType(1);
query.setOpenVideoStatus(1);
Page<AnchorListVo> app = anchorService.pageApp(pageQuery, query); Page<AnchorListVo> app = anchorService.pageApp(pageQuery, query);
List<AnchorListVo> records = app.getRecords(); List<AnchorListVo> records = app.getRecords();
RBucket<List<AnchorListVo>> bucket = redissonClient.getBucket(RedisHttpConstant.HOME_NEW_REDIS); RBucket<List<AnchorListVo>> bucket = redissonClient.getBucket(RedisHttpConstant.HOME_NEW_REDIS);
@@ -82,6 +84,7 @@ public class HomeManager {
AnchorListQuery query = new AnchorListQuery(); AnchorListQuery query = new AnchorListQuery();
// 0-默认查询 1-活跃查询 2-新人查询 3-同城查询 // 0-默认查询 1-活跃查询 2-新人查询 3-同城查询
query.setType(2); query.setType(2);
query.setOpenVideoStatus(1);
Page<AnchorListVo> app = anchorService.pageApp(pageQuery, query); Page<AnchorListVo> app = anchorService.pageApp(pageQuery, query);
List<AnchorListVo> records = app.getRecords(); List<AnchorListVo> records = app.getRecords();
RBucket<List<AnchorListVo>> bucket = redissonClient.getBucket(RedisHttpConstant.HOME_ACTIVE_REDIS); RBucket<List<AnchorListVo>> bucket = redissonClient.getBucket(RedisHttpConstant.HOME_ACTIVE_REDIS);
@@ -105,6 +108,8 @@ public class HomeManager {
if(query.getCityId() == null){ if(query.getCityId() == null){
return Collections.emptyList(); return Collections.emptyList();
} }
query.setOnlineStatus(1);
query.setOpenVideoStatus(1);
return anchorService.pageApp(pageQuery, query).getRecords(); return anchorService.pageApp(pageQuery, query).getRecords();
} }
Collections.shuffle(vos); Collections.shuffle(vos);

View File

@@ -51,9 +51,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.cityId != null and query.cityId != ''"> <if test="query.cityId != null and query.cityId != ''">
and t1.city_id = #{query.cityId} and t1.city_id = #{query.cityId}
</if> </if>
<if test="query.cityId != null and query.cityId != ''">
and t1.city_id = #{query.cityId}
</if>
<if test="query.onlineStatus != null"> <if test="query.onlineStatus != null">
and t3.status = #{query.onlineStatus} and t3.status = #{query.onlineStatus}
</if> </if>
<if test="query.openVideoStatus != null">
and t2.open_video_status = #{query.openVideoStatus}
</if>
<if test="query.type != null"> <if test="query.type != null">
<if test="query.type == 0"> <if test="query.type == 0">
order by t2.recommend_status desc,t2.update_time desc order by t2.recommend_status desc,t2.update_time desc