package com.fs.fastGpt.service.impl;

import com.fs.common.utils.DateUtils;
import com.fs.fastGpt.domain.FastGptChatKeyword;
import com.fs.fastGpt.mapper.FastGptChatKeywordMapper;
import com.fs.fastGpt.service.IFastGptChatKeywordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 关键字Service业务层处理
 * 
 * @author fs
 * @date 2024-09-30
 */
@Service
public class FastGptChatKeywordServiceImpl implements IFastGptChatKeywordService
{
    @Autowired
    private FastGptChatKeywordMapper fastGptChatKeywordMapper;

    /**
     * 查询关键字
     * 
     * @param keywordId 关键字主键
     * @return 关键字
     */
    @Override
    public FastGptChatKeyword selectFastGptChatKeywordByKeywordId(Long keywordId)
    {
        return fastGptChatKeywordMapper.selectFastGptChatKeywordByKeywordId(keywordId);
    }

    /**
     * 查询关键字列表
     * 
     * @param fastGptChatKeyword 关键字
     * @return 关键字
     */
    @Override
    public List<FastGptChatKeyword> selectFastGptChatKeywordList(FastGptChatKeyword fastGptChatKeyword)
    {
        return fastGptChatKeywordMapper.selectFastGptChatKeywordList(fastGptChatKeyword);
    }

    /**
     * 新增关键字
     * 
     * @param fastGptChatKeyword 关键字
     * @return 结果
     */
    @Override
    public int insertFastGptChatKeyword(FastGptChatKeyword fastGptChatKeyword)
    {
        fastGptChatKeyword.setCreateTime(DateUtils.getNowDate());
        return fastGptChatKeywordMapper.insertFastGptChatKeyword(fastGptChatKeyword);
    }

    /**
     * 修改关键字
     * 
     * @param fastGptChatKeyword 关键字
     * @return 结果
     */
    @Override
    public int updateFastGptChatKeyword(FastGptChatKeyword fastGptChatKeyword)
    {
        fastGptChatKeyword.setUpdateTime(DateUtils.getNowDate());
        return fastGptChatKeywordMapper.updateFastGptChatKeyword(fastGptChatKeyword);
    }

    /**
     * 批量删除关键字
     * 
     * @param keywordIds 需要删除的关键字主键
     * @return 结果
     */
    @Override
    public int deleteFastGptChatKeywordByKeywordIds(Long[] keywordIds)
    {
        return fastGptChatKeywordMapper.deleteFastGptChatKeywordByKeywordIds(keywordIds);
    }

    /**
     * 删除关键字信息
     * 
     * @param keywordId 关键字主键
     * @return 结果
     */
    @Override
    public int deleteFastGptChatKeywordByKeywordId(Long keywordId)
    {
        return fastGptChatKeywordMapper.deleteFastGptChatKeywordByKeywordId(keywordId);
    }
}
