Commit aa1ddd34 authored by 刘基明's avatar 刘基明

排序优化

parent 68042147
......@@ -16,6 +16,6 @@ import java.util.List;
* @since 2021-07-22
*/
public interface TopicMapper extends BaseMapper<TopicEntity> {
@Select("select * from topic where id>#{startId} and delete_tag=0 and is_conceal=0 order by id asc limit #{size}")
@Select("select * from topic where id>#{startId} and delete_tag=0 and is_conceal=0 order by id desc limit #{size}")
List<TopicEntity> selectGtIdPageable(@Param("startId") Long startId, @Param("size") Integer size);
}
......@@ -153,7 +153,7 @@ public class RankService {
this.rankTopicListTop4 = new ArrayList<>();
return;
}
List<TopicRankQo> topicRankQos = ConvertUtil.topicEntityToHotQos(topicEntities);
List<TopicRankQo> topicRankQos = ConvertUtil.topicEntityToRankQos(topicEntities);
// 统计话题下的所有主题数据
List<String> topicIds = topicRankQos.stream().map(TopicRankQo::getTopicId).collect(Collectors.toList());
......
......@@ -109,7 +109,7 @@ public class ConvertUtil {
return topicRankQo;
}
public static List<TopicRankQo> topicEntityToHotQos(List<TopicEntity> topicEntities) {
public static List<TopicRankQo> topicEntityToRankQos(List<TopicEntity> topicEntities) {
if (topicEntities == null) {
return Collections.emptyList();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment