package com.ruoyi.abuwx.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.abuwx.mapper.InfoCategoryMapper;
import com.ruoyi.abuwx.domain.InfoCategory;
import com.ruoyi.abuwx.service.IInfoCategoryService;

/**
 * 资讯类别Service业务层处理
 * 
 * @author lujie
 * @date 2024-12-19
 */
@Service
public class InfoCategoryServiceImpl implements IInfoCategoryService 
{
    @Autowired
    private InfoCategoryMapper infoCategoryMapper;

    /**
     * 查询资讯类别
     * 
     * @param id 资讯类别主键
     * @return 资讯类别
     */
    @Override
    public InfoCategory selectInfoCategoryById(Long id)
    {
        return infoCategoryMapper.selectInfoCategoryById(id);
    }

    /**
     * 查询资讯类别列表
     * 
     * @param infoCategory 资讯类别
     * @return 资讯类别
     */
    @Override
    public List<InfoCategory> selectInfoCategoryList(InfoCategory infoCategory)
    {
        return infoCategoryMapper.selectInfoCategoryList(infoCategory);
    }

    /**
     * 新增资讯类别
     * 
     * @param infoCategory 资讯类别
     * @return 结果
     */
    @Override
    public int insertInfoCategory(InfoCategory infoCategory)
    {
        infoCategory.setCreateTime(DateUtils.getNowDate());
        return infoCategoryMapper.insertInfoCategory(infoCategory);
    }

    /**
     * 修改资讯类别
     * 
     * @param infoCategory 资讯类别
     * @return 结果
     */
    @Override
    public int updateInfoCategory(InfoCategory infoCategory)
    {
        infoCategory.setUpdateTime(DateUtils.getNowDate());
        return infoCategoryMapper.updateInfoCategory(infoCategory);
    }

    /**
     * 批量删除资讯类别
     * 
     * @param ids 需要删除的资讯类别主键
     * @return 结果
     */
    @Override
    public int deleteInfoCategoryByIds(Long[] ids)
    {
        return infoCategoryMapper.deleteInfoCategoryByIds(ids);
    }

    /**
     * 删除资讯类别信息
     * 
     * @param id 资讯类别主键
     * @return 结果
     */
    @Override
    public int deleteInfoCategoryById(Long id)
    {
        return infoCategoryMapper.deleteInfoCategoryById(id);
    }
}
