use of org.hisp.dhis.webapi.webdomain.user.UserLookups in project dhis2-core by dhis2.
the class UserLookupController method lookUpFeedbackRecipients.
@GetMapping(value = "/feedbackRecipients")
public UserLookups lookUpFeedbackRecipients(@RequestParam String query) {
UserGroup feedbackRecipients = config.getConfiguration().getFeedbackRecipients();
if (feedbackRecipients == null) {
throw new IllegalQueryException(new ErrorMessage(ErrorCode.E6200));
}
UserQueryParams params = new UserQueryParams().setQuery(query).setUserGroups(Sets.newHashSet(feedbackRecipients)).setCanSeeOwnUserAuthorityGroups(true).setMax(25);
List<UserLookup> users = userService.getUsers(params).stream().map(UserLookup::fromUser).collect(Collectors.toList());
return new UserLookups(users);
}
use of org.hisp.dhis.webapi.webdomain.user.UserLookups in project dhis2-core by dhis2.
the class UserLookupController method lookUpUsers.
@GetMapping
public UserLookups lookUpUsers(@RequestParam String query) {
UserQueryParams params = new UserQueryParams().setQuery(query).setCanSeeOwnUserAuthorityGroups(true).setMax(25);
List<UserLookup> users = userService.getUsers(params).stream().map(UserLookup::fromUser).collect(Collectors.toList());
return new UserLookups(users);
}
Aggregations