package com.bonus.zlpt.home.service.impl;

import com.bonus.zlpt.home.mapper.BmTopicInfoMapper;
import com.bonus.zlpt.home.pojo.BmTopicDto;
import com.bonus.zlpt.home.pojo.BmTopicInfo;
import com.bonus.zlpt.home.service.BmTopicInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 专题资讯表(BmTopicInfo)表服务实现类
 *
 * @author makejava
 * @since 2023-12-04 09:48:36
 */
@Service("bmTopicInfoService")
public class BmTopicInfoServiceImpl implements BmTopicInfoService {

    @Resource
    private BmTopicInfoMapper bmTopicInfoMapper;
    /**
     * 获取专题资讯列表
     * @param bmTopicDto
     * @return
     */
    @Override
    public List<BmTopicInfo> selectSpecialInfoList(BmTopicDto bmTopicDto) {
        return bmTopicInfoMapper.selectSpecialInfoList(bmTopicDto);
    }

    /**
     * 新增专题资讯信息
     * @param bmTopicInfo
     * @return
     */
    @Override
    public int insertConfig(BmTopicInfo bmTopicInfo) {
        return bmTopicInfoMapper.insertConfig(bmTopicInfo);
    }

    /**
     * 根据id查询资讯信息
     * @param id
     * @return
     */
    @Override
    public BmTopicInfo selectListById(String id) {
        return bmTopicInfoMapper.selectListById(id);
    }

    /**
     * 编辑专题资讯信息
     * @param bmTopicInfo
     * @return
     */
    @Override
    public int update(BmTopicInfo bmTopicInfo) {
        return bmTopicInfoMapper.update(bmTopicInfo);
    }

    /**
     * 删除专题资讯信息
     * @param id
     * @return
     */
    @Override
    public int deleteById(String id) {
        return bmTopicInfoMapper.deleteById(id);
    }

    /**
     * 增加浏览次数
     * @param id
     */
    @Override
    public void insertNum(String id, Integer viewNum) {
        bmTopicInfoMapper.updateNum(id, viewNum);
    }
}

