package com.ruoyi.news.service.impl;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.news.domain.BomanNews;
import com.ruoyi.news.mapper.BomanNewsMapper;
import com.ruoyi.news.service.IBomanNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;


/**
 * boman_newsService业务层处理
 * 
 * @author boman
 * @date 2024-01-18
 */
@Service
public class BomanNewsServiceImpl implements IBomanNewsService
{
    @Autowired
    private BomanNewsMapper bomanNewsMapper;

    /**
     * 查询boman_news
     * 
     * @param newsId boman_news主键
     * @return boman_news
     */
    @Override
    public BomanNews selectBomanNewsByNewsId(Long newsId)
    {
        return bomanNewsMapper.selectBomanNewsByNewsId(newsId);
    }

    /**
     * 查询boman_news列表
     * 
     * @param bomanNews boman_news
     * @return boman_news
     */
    @Override
    public List<BomanNews> selectBomanNewsList(BomanNews bomanNews)
    {
        return bomanNewsMapper.selectBomanNewsList(bomanNews);
    }

    /**
     * 新增boman_news
     * 
     * @param bomanNews boman_news
     * @return 结果
     */
    @Override
    public int insertBomanNews(BomanNews bomanNews)
    {
        bomanNews.setCreateTime(DateUtils.getNowDate());
        return bomanNewsMapper.insertBomanNews(bomanNews);
    }

    /**
     * 修改boman_news
     * 
     * @param bomanNews boman_news
     * @return 结果
     */
    @Override
    public int updateBomanNews(BomanNews bomanNews)
    {
        bomanNews.setUpdateTime(DateUtils.getNowDate());
        return bomanNewsMapper.updateBomanNews(bomanNews);
    }

    /**
     * 批量删除boman_news
     * 
     * @param newsIds 需要删除的boman_news主键
     * @return 结果
     */
    @Override
    public int deleteBomanNewsByNewsIds(Long[] newsIds)
    {
        return bomanNewsMapper.deleteBomanNewsByNewsIds(newsIds);
    }

    /**
     * 删除boman_news信息
     * 
     * @param newsId boman_news主键
     * @return 结果
     */
    @Override
    public int deleteBomanNewsByNewsId(Long newsId)
    {
        return bomanNewsMapper.deleteBomanNewsByNewsId(newsId);
    }
}
