use of com.epam.ta.reportportal.ws.model.preference.PreferenceResource in project service-api by reportportal.
the class GetPreferenceHandlerImpl method getPreference.
@Override
public PreferenceResource getPreference(ReportPortalUser.ProjectDetails projectDetails, ReportPortalUser user) {
List<UserPreference> userPreferences = userPreferenceRepository.findByProjectIdAndUserId(projectDetails.getProjectId(), user.getUserId());
PreferenceResource preferenceResource = new PreferenceResource();
preferenceResource.setUserId(user.getUserId());
preferenceResource.setProjectId(projectDetails.getProjectId());
List<UserFilterResource> filters = userPreferences.stream().map(it -> UserFilterConverter.TO_FILTER_RESOURCE.apply(it.getFilter())).collect(Collectors.toList());
preferenceResource.setFilters(filters);
return preferenceResource;
}
Aggregations