package com.ruoyi.llm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.llm.mapper.CmcTopicMapper;
import com.ruoyi.llm.domain.CmcTopic;
import com.ruoyi.llm.service.ICmcTopicService;

/**
 * cmc聊天主题Service业务层处理
 * 
 * @author cmc
 * @date 2025-04-08
 */
@Service
public class CmcTopicServiceImpl implements ICmcTopicService 
{
    @Autowired
    private CmcTopicMapper cmcTopicMapper;

    /**
     * 查询cmc聊天主题
     * 
     * @param topicId cmc聊天主题主键
     * @return cmc聊天主题
     */
    @Override
    public CmcTopic selectCmcTopicByTopicId(String topicId)
    {
        return cmcTopicMapper.selectCmcTopicByTopicId(topicId);
    }

    /**
     * 查询cmc聊天主题列表
     * 
     * @param cmcTopic cmc聊天主题
     * @return cmc聊天主题
     */
    @Override
    public List<CmcTopic> selectCmcTopicList(CmcTopic cmcTopic)
    {
        return cmcTopicMapper.selectCmcTopicList(cmcTopic);
    }

    /**
     * 新增cmc聊天主题
     * 
     * @param cmcTopic cmc聊天主题
     * @return 结果
     */
    @Override
    public int insertCmcTopic(CmcTopic cmcTopic)
    {
        cmcTopic.setCreateTime(DateUtils.getNowDate());
        return cmcTopicMapper.insertCmcTopic(cmcTopic);
    }

    /**
     * 修改cmc聊天主题
     * 
     * @param cmcTopic cmc聊天主题
     * @return 结果
     */
    @Override
    public int updateCmcTopic(CmcTopic cmcTopic)
    {
        return cmcTopicMapper.updateCmcTopic(cmcTopic);
    }

    /**
     * 批量删除cmc聊天主题
     * 
     * @param topicIds 需要删除的cmc聊天主题主键
     * @return 结果
     */
    @Override
    public int deleteCmcTopicByTopicIds(String[] topicIds)
    {
        return cmcTopicMapper.deleteCmcTopicByTopicIds(topicIds);
    }

    /**
     * 删除cmc聊天主题信息
     * 
     * @param topicId cmc聊天主题主键
     * @return 结果
     */
    @Override
    public int deleteCmcTopicByTopicId(String topicId)
    {
        return cmcTopicMapper.deleteCmcTopicByTopicId(topicId);
    }
}
