Package org.codelibs.fess.app.service
Class FavoriteLogService
java.lang.Object
org.codelibs.fess.app.service.FavoriteLogService
Service class for managing favorite log operations.
Provides functionality to add URLs to user favorites and retrieve favorite URL lists.
This service handles the persistence and retrieval of favorite log entries in the search system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.codelibs.fess.opensearch.log.exbhv.FavoriteLogBhvBehavior class for favorite log database operations.protected org.codelibs.fess.mylasta.direction.FessConfigConfiguration settings for the Fess search system.protected SystemHelperSystem helper for common system operations and utilities.protected org.codelibs.fess.opensearch.log.exbhv.UserInfoBhvBehavior class for user information database operations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddUrl(String userCode, BiConsumer<org.codelibs.fess.opensearch.log.exentity.UserInfo, org.codelibs.fess.opensearch.log.exentity.FavoriteLog> favoriteLogLambda) Adds a URL to a user's favorite list.getUrlList(String userCode, List<String> urlList) Retrieves a list of URLs that are in the user's favorites from the provided URL list.
-
Field Details
-
systemHelper
System helper for common system operations and utilities. -
userInfoBhv
protected org.codelibs.fess.opensearch.log.exbhv.UserInfoBhv userInfoBhvBehavior class for user information database operations. -
favoriteLogBhv
protected org.codelibs.fess.opensearch.log.exbhv.FavoriteLogBhv favoriteLogBhvBehavior class for favorite log database operations. -
fessConfig
protected org.codelibs.fess.mylasta.direction.FessConfig fessConfigConfiguration settings for the Fess search system.
-
-
Constructor Details
-
FavoriteLogService
public FavoriteLogService()Default constructor.
-
-
Method Details
-
addUrl
public boolean addUrl(String userCode, BiConsumer<org.codelibs.fess.opensearch.log.exentity.UserInfo, org.codelibs.fess.opensearch.log.exentity.FavoriteLog> favoriteLogLambda) Adds a URL to a user's favorite list. This method looks up the user by their code and creates a new favorite log entry using the provided lambda function to populate the favorite log data.- Parameters:
userCode- the unique code identifying the userfavoriteLogLambda- a lambda function that accepts UserInfo and FavoriteLog to populate the favorite log data- Returns:
- true if the URL was successfully added to favorites, false if the user was not found
-
getUrlList
Retrieves a list of URLs that are in the user's favorites from the provided URL list. This method filters the input URL list to return only those URLs that the specified user has marked as favorites.- Parameters:
userCode- the unique code identifying the userurlList- the list of URLs to check against the user's favorites- Returns:
- a list of URLs from the input list that are in the user's favorites, or an empty list if the user is not found or has no matching favorites
-