package com.ningdatech.pmapi.user.service.impl;

import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.mapper.UserInfoMapper;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * <p>
 * 用户信息表 服务实现类
 * </p>
 *
 * @author Liuxinxin
 * @since 2023-01-04
 */
@Service
@RequiredArgsConstructor
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements IUserInfoService {
    private final UserInfoMapper userInfoMapper;
    @Override
    public Map<Long, UserInfo> getUserMapByIds(Set<String> staterUsers) {
        List<UserInfo> userInfos = userInfoMapper.selectBatchIds(staterUsers);
        return userInfos.stream().collect(Collectors.toMap(UserInfo::getId,u -> u ));
    }
}
