package com.ruoyi.business.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.business.mapper.TbUserRewardStoreMapper;
import com.ruoyi.business.domain.TbUserRewardStore;
import com.ruoyi.business.service.ITbUserRewardStoreService;
import com.ruoyi.common.core.text.Convert;

/**
 * 我收藏的悬赏Service业务层处理
 * 
 * @author xiatao
 * @date 2022-01-18
 */
@Service
public class TbUserRewardStoreServiceImpl implements ITbUserRewardStoreService 
{
    @Autowired
    private TbUserRewardStoreMapper tbUserRewardStoreMapper;

    /**
     * 查询我收藏的悬赏
     * 
     * @param userRewardId 我收藏的悬赏主键
     * @return 我收藏的悬赏
     */
    @Override
    public TbUserRewardStore selectTbUserRewardStoreByUserRewardId(Long userRewardId)
    {
        return tbUserRewardStoreMapper.selectTbUserRewardStoreByUserRewardId(userRewardId);
    }

    /**
     * 查询我收藏的悬赏列表
     * 
     * @param tbUserRewardStore 我收藏的悬赏
     * @return 我收藏的悬赏
     */
    @Override
    public List<TbUserRewardStore> selectTbUserRewardStoreList(TbUserRewardStore tbUserRewardStore)
    {
        return tbUserRewardStoreMapper.selectTbUserRewardStoreList(tbUserRewardStore);
    }

    /**
     * 新增我收藏的悬赏
     * 
     * @param tbUserRewardStore 我收藏的悬赏
     * @return 结果
     */
    @Override
    public int insertTbUserRewardStore(TbUserRewardStore tbUserRewardStore)
    {
        tbUserRewardStore.setCreateTime(DateUtils.getNowDate());
        return tbUserRewardStoreMapper.insertTbUserRewardStore(tbUserRewardStore);
    }

    /**
     * 修改我收藏的悬赏
     * 
     * @param tbUserRewardStore 我收藏的悬赏
     * @return 结果
     */
    @Override
    public int updateTbUserRewardStore(TbUserRewardStore tbUserRewardStore)
    {
        return tbUserRewardStoreMapper.updateTbUserRewardStore(tbUserRewardStore);
    }

    /**
     * 批量删除我收藏的悬赏
     * 
     * @param userRewardIds 需要删除的我收藏的悬赏主键
     * @return 结果
     */
    @Override
    public int deleteTbUserRewardStoreByUserRewardIds(String userRewardIds)
    {
        return tbUserRewardStoreMapper.deleteTbUserRewardStoreByUserRewardIds(Convert.toStrArray(userRewardIds));
    }

    /**
     * 删除我收藏的悬赏信息
     * 
     * @param userRewardId 我收藏的悬赏主键
     * @return 结果
     */
    @Override
    public int deleteTbUserRewardStoreByUserRewardId(Long userRewardId)
    {
        return tbUserRewardStoreMapper.deleteTbUserRewardStoreByUserRewardId(userRewardId);
    }
}
