package cn.axzo.msg.center.message.service.impl.person;

import cn.axzo.basics.profiles.dto.basic.IdentityProfileDto;
import lombok.RequiredArgsConstructor;

import java.util.List;

import static java.util.stream.Collectors.toList;

/**
 * @author yanglin
 */
@RequiredArgsConstructor
public class PersonIdInfo {

    private final List<IdentityProfileDto> identityProfiles;

    public List<Long> getPersonIds() {
        return identityProfiles.stream()
                .map(i -> i.getPersonProfile().getId())
                .distinct()
                .collect(toList());

    }
}