package com.easyproject.system.service.operate.impl;

import java.util.List;

import com.easyproject.common.utils.DateUtils;
import com.easyproject.service.domain.operate.OperateHotQuestions;
import com.easyproject.service.mapper.operate.OperateHotQuestionsMapper;
import com.easyproject.system.service.operate.IOperateHotQuestionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 热门问题Service业务层处理
 *
 * @author easyproject
 * @date 2025-03-19
 */
@Service
public class OperateHotQuestionsServiceImpl implements IOperateHotQuestionsService {
    @Autowired
    private OperateHotQuestionsMapper operateHotQuestionsMapper;

    /**
     * 查询热门问题
     *
     * @param id 热门问题主键
     * @return 热门问题
     */
    @Override
    public OperateHotQuestions selectOperateHotQuestionsById(Long id) {
        return operateHotQuestionsMapper.selectOperateHotQuestionsById(id);
    }

    /**
     * 查询热门问题列表
     *
     * @param operateHotQuestions 热门问题
     * @return 热门问题
     */
    @Override
    public List<OperateHotQuestions> selectOperateHotQuestionsList(OperateHotQuestions operateHotQuestions) {
        return operateHotQuestionsMapper.selectOperateHotQuestionsList(operateHotQuestions);
    }

    /**
     * 新增热门问题
     *
     * @param operateHotQuestions 热门问题
     * @return 结果
     */
    @Override
    public int insertOperateHotQuestions(OperateHotQuestions operateHotQuestions) {
        operateHotQuestions.setCreateTime(DateUtils.getNowDate());
        return operateHotQuestionsMapper.insertOperateHotQuestions(operateHotQuestions);
    }

    /**
     * 修改热门问题
     *
     * @param operateHotQuestions 热门问题
     * @return 结果
     */
    @Override
    public int updateOperateHotQuestions(OperateHotQuestions operateHotQuestions) {
        operateHotQuestions.setUpdateTime(DateUtils.getNowDate());
        return operateHotQuestionsMapper.updateOperateHotQuestions(operateHotQuestions);
    }

    /**
     * 批量删除热门问题
     *
     * @param ids 需要删除的热门问题主键
     * @return 结果
     */
    @Override
    public int deleteOperateHotQuestionsByIds(Long[] ids) {
        return operateHotQuestionsMapper.deleteOperateHotQuestionsByIds(ids);
    }

    /**
     * 删除热门问题信息
     *
     * @param id 热门问题主键
     * @return 结果
     */
    @Override
    public int deleteOperateHotQuestionsById(Long id) {
        return operateHotQuestionsMapper.deleteOperateHotQuestionsById(id);
    }
}
