master:用户搜索历史去重;

pull/1121/head
liujiang 2025-09-17 16:24:28 +08:00
parent 7f76feb420
commit 2d250a5806
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ public class UserSearchHistoryServiceImpl implements IUserSearchHistoryService {
}
// 按照搜索时间倒序排列,最新的搜索数据展示在最前面
return redisList.stream().sorted(Comparator.comparing(UserSearchHistoryDTO::getSearchTime).reversed())
.map(UserSearchHistoryDTO::getSearchContent).collect(Collectors.toList());
.map(UserSearchHistoryDTO::getSearchContent).distinct().collect(Collectors.toList());
}
/**