package com.seer.teach.teacher.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seer.teach.teacher.module.entity.QuestionOptionsEntity;
import com.seer.teach.teacher.module.mapper.QuestionOptionsMapper;
import com.seer.teach.teacher.service.QuestionOptionsService;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * <p>
 * 题目选项表 服务实现类
 * </p>
 *
 * @author Wang
 * @since 2025-10-09 15:20:36
 */
@Service
public class QuestionOptionsServiceImpl extends ServiceImpl<QuestionOptionsMapper, QuestionOptionsEntity> implements QuestionOptionsService {

    @Override
    public List<QuestionOptionsEntity> getQuestionOptionsByQuestionId(Integer questionId) {
        return super.list(new LambdaQueryWrapper<>(QuestionOptionsEntity.class).eq(QuestionOptionsEntity::getQuestionId, questionId));
    }

    @Override
    public List<QuestionOptionsEntity> getQuestionOptionsByQuestionIds(Collection<Integer> questionIds) {
        return super.list(new LambdaQueryWrapper<>(QuestionOptionsEntity.class).in(QuestionOptionsEntity::getQuestionId, questionIds));
    }
}
