历史检索记录完善

This commit is contained in:
18401019693
2022-08-08 10:26:45 +08:00
parent 90bc939a61
commit 76a0d9ec8c
5 changed files with 63 additions and 7 deletions

View File

@@ -78,6 +78,9 @@ public class SearchHistoryRecordManager extends BaseCacheManager {
if (historyRecordList.size() == 10) {
historyRecordList.remove(0);
}
for (SearchHistoryModel historyModel : historyRecordList) {
if (historyModel.getSimplified().equals(key)) return;
}
historyRecordList.add(new SearchHistoryModel(key, value));
String json = new Gson().toJson(historyRecordList);
put(KEY_HISTORY_RECORD, json);