Class UserSettingsService
java.lang.Object
fr.tiogars.inception.settings.user.services.UserSettingsService
Coordinates user settings, the ANONYMOUS role settings and their defaults.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUserSettingsService(UserSettingsRepository repository, UserRepository userRepository) -
Method Summary
Modifier and TypeMethodDescriptionfindByUserId(Long userId) Returns the settings of an account holding the USER role, or empty otherwise.findByUsername(String username) Returns the settings of the authenticated account, or empty when the account does not exist.static UserSettingstoRecord(UserSettingsEntity entity) updateAnonymous(UpdateUserSettingsRequest request) updateByUserId(Long userId, UpdateUserSettingsRequest request) Updates the settings of an account holding the USER role, or returns empty otherwise.updateByUsername(String username, UpdateUserSettingsRequest request) Updates the settings of the authenticated account, or returns empty when the account does not exist.
-
Field Details
-
DEFAULT_VIEW_MODE
- See Also:
-
-
Constructor Details
-
UserSettingsService
@Autowired public UserSettingsService(UserSettingsRepository repository, UserRepository userRepository)
-
-
Method Details
-
findByUsername
Returns the settings of the authenticated account, or empty when the account does not exist. -
updateByUsername
@Transactional public Optional<UserSettings> updateByUsername(String username, UpdateUserSettingsRequest request) Updates the settings of the authenticated account, or returns empty when the account does not exist. -
findByUserId
Returns the settings of an account holding the USER role, or empty otherwise. -
updateByUserId
@Transactional public Optional<UserSettings> updateByUserId(Long userId, UpdateUserSettingsRequest request) Updates the settings of an account holding the USER role, or returns empty otherwise. -
findAnonymous
-
updateAnonymous
-
toRecord
-