use of com.infiniteautomation.mango.rest.latest.model.RestModelMapper in project ma-modules-public by infiniteautomation.
the class UserModelMapping method map.
@Override
public UserModel map(Object o, PermissionHolder currentUser, RestModelMapper mapper) {
User user = (User) o;
UserModel model = new UserModel(user);
List<LinkedAccountModel> linkedAccounts = usersService.getLinkedAccounts(user).stream().map(account -> mapper.map(account, LinkedAccountModel.class, currentUser)).collect(Collectors.toList());
model.setLinkedAccounts(linkedAccounts);
return model;
}
Aggregations