package com.ruoyi.brewery.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.brewery.mapper.WyBeerReviewLikeMapper;
import com.ruoyi.brewery.domain.WyBeerReviewLike;
import com.ruoyi.brewery.service.IWyBeerReviewLikeService;

/**
 * 酒评点赞Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-21
 */
@Service
public class WyBeerReviewLikeServiceImpl implements IWyBeerReviewLikeService 
{
    @Autowired
    private WyBeerReviewLikeMapper wyBeerReviewLikeMapper;

    /**
     * 查询酒评点赞
     * 
     * @param id 酒评点赞主键
     * @return 酒评点赞
     */
    @Override
    public WyBeerReviewLike selectWyBeerReviewLikeById(Long id)
    {
        return wyBeerReviewLikeMapper.selectWyBeerReviewLikeById(id);
    }

    @Override
    public WyBeerReviewLike selectWyBeerReviewLikeByReviewIdAndCustomerId(Long id, Long customerId)
    {
        return wyBeerReviewLikeMapper.selectWyBeerReviewLikeByReviewIdAndCustomerId(id,customerId);
    }

    /**
     * 查询酒评点赞列表
     * 
     * @param wyBeerReviewLike 酒评点赞
     * @return 酒评点赞
     */
    @Override
    public List<WyBeerReviewLike> selectWyBeerReviewLikeList(WyBeerReviewLike wyBeerReviewLike)
    {
        return wyBeerReviewLikeMapper.selectWyBeerReviewLikeList(wyBeerReviewLike);
    }

    /**
     * 新增酒评点赞
     * 
     * @param wyBeerReviewLike 酒评点赞
     * @return 结果
     */
    @Override
    public int insertWyBeerReviewLike(WyBeerReviewLike wyBeerReviewLike)
    {
        wyBeerReviewLike.setCreateTime(DateUtils.getNowDate());
        return wyBeerReviewLikeMapper.insertWyBeerReviewLike(wyBeerReviewLike);
    }

    /**
     * 修改酒评点赞
     * 
     * @param wyBeerReviewLike 酒评点赞
     * @return 结果
     */
    @Override
    public int updateWyBeerReviewLike(WyBeerReviewLike wyBeerReviewLike)
    {
        wyBeerReviewLike.setUpdateTime(DateUtils.getNowDate());
        return wyBeerReviewLikeMapper.updateWyBeerReviewLike(wyBeerReviewLike);
    }

    /**
     * 批量删除酒评点赞
     * 
     * @param ids 需要删除的酒评点赞主键
     * @return 结果
     */
    @Override
    public int deleteWyBeerReviewLikeByIds(Long[] ids)
    {
        return wyBeerReviewLikeMapper.deleteWyBeerReviewLikeByIds(ids);
    }

    /**
     * 删除酒评点赞信息
     * 
     * @param id 酒评点赞主键
     * @return 结果
     */
    @Override
    public int deleteWyBeerReviewLikeById(Long id)
    {
        return wyBeerReviewLikeMapper.deleteWyBeerReviewLikeById(id);
    }

    @Override
    public int deleteWyBeerReviewLikeByReviewId(Long reviewId)
    {
        return wyBeerReviewLikeMapper.deleteWyBeerReviewLikeByReviewId(reviewId);
    }
}
