package com.ruoyi.mall.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.mall.mapper.ArticleTagMapper;
import com.ruoyi.mall.domain.ArticleTag;
import com.ruoyi.mall.service.IArticleTagService;

/**
 * 帖子话题Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-09
 */
@Service
public class ArticleTagServiceImpl implements IArticleTagService 
{
    @Autowired
    private ArticleTagMapper articleTagMapper;

    /**
     * 查询帖子话题
     * 
     * @param tagId 帖子话题主键
     * @return 帖子话题
     */
    @Override
    public ArticleTag selectArticleTagByTagId(Long tagId)
    {
        return articleTagMapper.selectArticleTagByTagId(tagId);
    }

    /**
     * 查询帖子话题列表
     * 
     * @param articleTag 帖子话题
     * @return 帖子话题
     */
    @Override
    public List<ArticleTag> selectArticleTagList(ArticleTag articleTag)
    {
        return articleTagMapper.selectArticleTagList(articleTag);
    }

    /**
     * 新增帖子话题
     * 
     * @param articleTag 帖子话题
     * @return 结果
     */
    @Override
    public int insertArticleTag(ArticleTag articleTag)
    {
        articleTag.setCreateTime(DateUtils.getNowDate());
        return articleTagMapper.insertArticleTag(articleTag);
    }

    /**
     * 修改帖子话题
     * 
     * @param articleTag 帖子话题
     * @return 结果
     */
    @Override
    public int updateArticleTag(ArticleTag articleTag)
    {
        articleTag.setUpdateTime(DateUtils.getNowDate());
        return articleTagMapper.updateArticleTag(articleTag);
    }

    /**
     * 批量删除帖子话题
     * 
     * @param tagIds 需要删除的帖子话题主键
     * @return 结果
     */
    @Override
    public int deleteArticleTagByTagIds(Long[] tagIds)
    {
        return articleTagMapper.deleteArticleTagByTagIds(tagIds);
    }

    /**
     * 删除帖子话题信息
     * 
     * @param tagId 帖子话题主键
     * @return 结果
     */
    @Override
    public int deleteArticleTagByTagId(Long tagId)
    {
        return articleTagMapper.deleteArticleTagByTagId(tagId);
    }
}
