package com.fdkankan.ucenter.service.impl;

import com.fdkankan.ucenter.entity.FeedbackOption;
import com.fdkankan.ucenter.mapper.IFeedbackOptionMapper;
import com.fdkankan.ucenter.service.IFeedbackOptionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2025-11-14
 */
@Service
public class FeedbackOptionServiceImpl extends ServiceImpl<IFeedbackOptionMapper, FeedbackOption> implements IFeedbackOptionService {

    @Override
    public HashMap<Integer, FeedbackOption> getMapByIds(HashSet<Integer> optionIds) {
        HashMap<Integer, FeedbackOption> map = new HashMap<>();
        if(ObjectUtils.isNotEmpty(optionIds)){
            List<FeedbackOption> feedbackOptions = this.listByIds(optionIds);
            feedbackOptions.forEach(e -> map.put(e.getId(),e));
        }
        return map;
    }
}
