package com.fs.live.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.common.utils.DateUtils;
import com.fs.live.domain.LiveAnchor;
import com.fs.live.mapper.LiveAnchorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.live.mapper.LiveQuestionMapper;
import com.fs.live.domain.LiveQuestion;
import com.fs.live.service.ILiveQuestionService;

/**
 * 问答Service业务层处理
 * 
 * @author fs
 * @date 2025-01-17
 */
@Service
public class LiveQuestionServiceImpl extends ServiceImpl<LiveQuestionMapper, LiveQuestion> implements ILiveQuestionService
{
    @Autowired
    private LiveQuestionMapper liveQuestionMapper;

    /**
     * 查询问答
     * 
     * @param questionId 问答主键
     * @return 问答
     */
    @Override
    public LiveQuestion selectLiveQuestionByQuestionId(Long questionId)
    {
        return liveQuestionMapper.selectLiveQuestionByQuestionId(questionId);
    }

    /**
     * 查询问答列表
     * 
     * @param liveQuestion 问答
     * @return 问答
     */
    @Override
    public List<LiveQuestion> selectLiveQuestionList(LiveQuestion liveQuestion)
    {
        return liveQuestionMapper.selectLiveQuestionList(liveQuestion);
    }

    /**
     * 新增问答
     * 
     * @param liveQuestion 问答
     * @return 结果
     */
    @Override
    public int insertLiveQuestion(LiveQuestion liveQuestion)
    {
        liveQuestion.setCreateTime(DateUtils.getNowDate());
        return liveQuestionMapper.insertLiveQuestion(liveQuestion);
    }

    /**
     * 修改问答
     * 
     * @param liveQuestion 问答
     * @return 结果
     */
    @Override
    public int updateLiveQuestion(LiveQuestion liveQuestion)
    {
        liveQuestion.setUpdateTime(DateUtils.getNowDate());
        return liveQuestionMapper.updateLiveQuestion(liveQuestion);
    }

    /**
     * 批量删除问答
     * 
     * @param questionIds 需要删除的问答主键
     * @return 结果
     */
    @Override
    public int deleteLiveQuestionByQuestionIds(Long[] questionIds)
    {
        return liveQuestionMapper.deleteLiveQuestionByQuestionIds(questionIds);
    }

    /**
     * 删除问答信息
     * 
     * @param questionId 问答主键
     * @return 结果
     */
    @Override
    public int deleteLiveQuestionByQuestionId(Long questionId)
    {
        return liveQuestionMapper.deleteLiveQuestionByQuestionId(questionId);
    }
}
