Package com.mindstore.backend.service
Class SearchHistoryService
java.lang.Object
com.mindstore.backend.service.SearchHistoryService
Service class for search history entity
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSearchHistoryService(SearchHistoryRepository searchHistoryRepository) Search history service -
Method Summary
Modifier and TypeMethodDescriptionfunction: We return a list of maximum 10 strings that represent the most recent searchesvoidsaveSearch(String term) function: saving a search that the user made to the serach history repo
-
Field Details
-
searchHistoryRepository
Repository for the search history
-
-
Constructor Details
-
SearchHistoryService
Search history service- Parameters:
searchHistoryRepository- repository for search history
-
-
Method Details
-
saveSearch
function: saving a search that the user made to the serach history repo- Parameters:
term- the term that we want to save
-
getRecentSearches
function: We return a list of maximum 10 strings that represent the most recent searches- Returns:
- a list of strings with the recent searches
-