package com.fs.fastGpt.service.impl;

import com.fs.common.utils.DateUtils;
import com.fs.fastGpt.domain.FastgptTag;
import com.fs.fastGpt.mapper.FastgptTagMapper;
import com.fs.fastGpt.service.IFastgptTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ai标签Service业务层处理
 *
 * @author fs
 * @date 2024-12-20
 */
@Service
public class FastgptTagServiceImpl implements IFastgptTagService
{
    @Autowired
    private FastgptTagMapper fastgptTagMapper;

    /**
     * 查询ai标签
     *
     * @param id ai标签主键
     * @return ai标签
     */
    @Override
    public FastgptTag selectFastgptTagById(Long id)
    {
        return fastgptTagMapper.selectFastgptTagById(id);
    }

    /**
     * 查询ai标签列表
     *
     * @param fastgptTag ai标签
     * @return ai标签
     */
    @Override
    public List<FastgptTag> selectFastgptTagList(FastgptTag fastgptTag)
    {
        return fastgptTagMapper.selectFastgptTagList(fastgptTag);
    }

    /**
     * 新增ai标签
     *
     * @param fastgptTag ai标签
     * @return 结果
     */
    @Override
    public int insertFastgptTag(FastgptTag fastgptTag)
    {
        fastgptTag.setCreateTime(DateUtils.getNowDate());
        return fastgptTagMapper.insertFastgptTag(fastgptTag);
    }

    /**
     * 修改ai标签
     *
     * @param fastgptTag ai标签
     * @return 结果
     */
    @Override
    public int updateFastgptTag(FastgptTag fastgptTag)
    {
        fastgptTag.setUpdateTime(DateUtils.getNowDate());
        return fastgptTagMapper.updateFastgptTag(fastgptTag);
    }

    /**
     * 批量删除ai标签
     *
     * @param ids 需要删除的ai标签主键
     * @return 结果
     */
    @Override
    public int deleteFastgptTagByIds(Long[] ids)
    {
        return fastgptTagMapper.deleteFastgptTagByIds(ids);
    }

    /**
     * 删除ai标签信息
     *
     * @param id ai标签主键
     * @return 结果
     */
    @Override
    public int deleteFastgptTagById(Long id)
    {
        return fastgptTagMapper.deleteFastgptTagById(id);
    }
}
