package com.fs.store.service.impl;

import com.fs.store.domain.FsHomeArticleCategory;
import com.fs.store.mapper.FsHomeArticleCategoryMapper;
import com.fs.store.param.home.HomeArticleCategoryPageParam;
import com.fs.store.service.IFsHomeArticleCategoryService;
import com.fs.store.vo.home.HomeArticleCategoryListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 期刊分类Service业务层处理
 *
 * @author fs
 * @date 2025-05-21
 */
@Service
public class FsHomeArticleCategoryServiceImpl implements IFsHomeArticleCategoryService
{
    @Autowired
    private FsHomeArticleCategoryMapper fsHomeArticleCategoryMapper;

    /**
     * 查询期刊分类
     *
     * @param categoryId 期刊分类ID
     * @return 期刊分类
     */
    @Override
    public FsHomeArticleCategory selectFsHomeArticleCategoryById(Long categoryId)
    {
        return fsHomeArticleCategoryMapper.selectFsHomeArticleCategoryById(categoryId);
    }

    /**
     * 查询期刊分类列表
     *
     * @param fsHomeArticleCategory 期刊分类
     * @return 期刊分类
     */
    @Override
    public List<FsHomeArticleCategory> selectFsHomeArticleCategoryList(FsHomeArticleCategory fsHomeArticleCategory)
    {
        return fsHomeArticleCategoryMapper.selectFsHomeArticleCategoryList(fsHomeArticleCategory);
    }

    /**
     * 新增期刊分类
     *
     * @param fsHomeArticleCategory 期刊分类
     * @return 结果
     */
    @Override
    public int insertFsHomeArticleCategory(FsHomeArticleCategory fsHomeArticleCategory)
    {
        return fsHomeArticleCategoryMapper.insertFsHomeArticleCategory(fsHomeArticleCategory);
    }

    /**
     * 修改期刊分类
     *
     * @param fsHomeArticleCategory 期刊分类
     * @return 结果
     */
    @Override
    public int updateFsHomeArticleCategory(FsHomeArticleCategory fsHomeArticleCategory)
    {
        return fsHomeArticleCategoryMapper.updateFsHomeArticleCategory(fsHomeArticleCategory);
    }

    /**
     * 批量删除期刊分类
     *
     * @param categoryIds 需要删除的期刊分类ID
     * @return 结果
     */
    @Override
    public int deleteFsHomeArticleCategoryByIds(Long[] categoryIds)
    {
        return fsHomeArticleCategoryMapper.deleteFsHomeArticleCategoryByIds(categoryIds);
    }

    /**
     * 删除期刊分类信息
     *
     * @param categoryId 期刊分类ID
     * @return 结果
     */
    @Override
    public int deleteFsHomeArticleCategoryById(Long categoryId)
    {
        return fsHomeArticleCategoryMapper.deleteFsHomeArticleCategoryById(categoryId);
    }

    @Override
    public List<HomeArticleCategoryListVO> selectHomeArticleCategoryPageList(HomeArticleCategoryPageParam param) {
        return fsHomeArticleCategoryMapper.selectHomeArticleCategoryPageList(param);
    }
}
