Package org.openwms.core.preferences.api
Interface UserPreferencesApi
@FeignClient(name="preferences-service",
qualifiers="preferencesApi")
public interface UserPreferencesApi
A UserPreferencesApi defines the public REST API to manage UserPreferences.
- Author:
- Heiko Scherrer
-
Method Summary
Modifier and TypeMethodDescriptioncreateOrUpdate
(UserPreferenceVO userPreference) Create or update an UserPreference.findByUser
(String user) Find and return all existing UserPreferences that belong to anuser
.findByUserAndKey
(String user, String key) Find and return one UserPreference that belongs to anuser
and has the givenkey
.
-
Method Details
-
findByUser
@GetMapping(value="/v1/preferences", params="user") List<PreferenceVO> findByUser(@RequestParam("user") String user) Find and return all existing UserPreferences that belong to anuser
.- Parameters:
user
- The owning user of the preferences- Returns:
- An infinite filtered stream of PreferenceVO
-
findByUserAndKey
@GetMapping(value="/v1/preferences", params={"user","key"}) PreferenceVO findByUserAndKey(@RequestParam("user") String user, @RequestParam("key") String key) Find and return one UserPreference that belongs to anuser
and has the givenkey
.- Parameters:
user
- The owning user of the preferencekey
- The key of the preference- Returns:
- One single instance
-
createOrUpdate
@PostMapping("/v1/preferences") UserPreferenceVO createOrUpdate(@RequestBody UserPreferenceVO userPreference) Create or update an UserPreference.- Parameters:
userPreference
- The user preference- Returns:
- The saved instance
-