package com.ruoyi.abuwx.service.impl;

import com.ruoyi.abuwx.domain.QuestionInfo;
import com.ruoyi.abuwx.mapper.QuestionInfoMapper;
import com.ruoyi.abuwx.service.IQuestionInfoService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 题目管理Service业务层处理
 *
 * @author lujie
 * @date 2025-01-06
 */
@Service
public class QuestionInfoServiceImpl implements IQuestionInfoService {
    @Autowired
    private QuestionInfoMapper questionInfoMapper;

    /**
     * 查询题目管理
     *
     * @param id 题目管理主键
     * @return 题目管理
     */
    @Override
    public QuestionInfo selectQuestionInfoById(Long id) {
        return questionInfoMapper.selectQuestionInfoById(id);
    }

    /**
     * 查询题目管理列表
     *
     * @param questionInfo 题目管理
     * @return 题目管理
     */
    @Override
    public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo) {
        return questionInfoMapper.selectQuestionInfoList(questionInfo);
    }

    /**
     * 新增题目管理
     *
     * @param questionInfo 题目管理
     * @return 结果
     */
    @Override
    public int insertQuestionInfo(QuestionInfo questionInfo) {
        questionInfo.setCreateTime(DateUtils.getNowDate());
        return questionInfoMapper.insertQuestionInfo(questionInfo);
    }

    /**
     * 修改题目管理
     *
     * @param questionInfo 题目管理
     * @return 结果
     */
    @Override
    public int updateQuestionInfo(QuestionInfo questionInfo) {
        questionInfo.setUpdateTime(DateUtils.getNowDate());
        return questionInfoMapper.updateQuestionInfo(questionInfo);
    }

    /**
     * 批量删除题目管理
     *
     * @param ids 需要删除的题目管理主键
     * @return 结果
     */
    @Override
    public int deleteQuestionInfoByIds(Long[] ids) {
        return questionInfoMapper.deleteQuestionInfoByIds(ids);
    }

    /**
     * 删除题目管理信息
     *
     * @param id 题目管理主键
     * @return 结果
     */
    @Override
    public int deleteQuestionInfoById(Long id) {
        return questionInfoMapper.deleteQuestionInfoById(id);
    }
}
