package com.playlet.system.service.impl;

import java.util.List;
import com.playlet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.playlet.system.mapper.PublicUserRecordMapper;
import com.playlet.system.domain.PublicUserRecord;
import com.playlet.system.service.IPublicUserRecordService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 公众号用户浏览记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-15
 */
@Service
public class PublicUserRecordServiceImpl extends ServiceImpl<PublicUserRecordMapper, PublicUserRecord> implements IPublicUserRecordService
{
    @Autowired
    private PublicUserRecordMapper publicUserRecordMapper;

    /**
     * 查询公众号用户浏览记录
     *
     * @param id 公众号用户浏览记录主键
     * @return 公众号用户浏览记录
     */
    @Override
    public PublicUserRecord selectPublicUserRecordById(Long id)
    {
        return publicUserRecordMapper.selectPublicUserRecordById(id);
    }

    /**
     * 查询公众号用户浏览记录列表
     *
     * @param publicUserRecord 公众号用户浏览记录
     * @return 公众号用户浏览记录
     */
    @Override
    public List<PublicUserRecord> selectPublicUserRecordList(PublicUserRecord publicUserRecord)
    {
        return publicUserRecordMapper.selectPublicUserRecordList(publicUserRecord);
    }

    /**
     * 新增公众号用户浏览记录
     *
     * @param publicUserRecord 公众号用户浏览记录
     * @return 结果
     */
    @Override
    public int insertPublicUserRecord(PublicUserRecord publicUserRecord)
    {
        publicUserRecord.setCreateTime(DateUtils.getNowDate());
        return publicUserRecordMapper.insertPublicUserRecord(publicUserRecord);
    }

    /**
     * 修改公众号用户浏览记录
     *
     * @param publicUserRecord 公众号用户浏览记录
     * @return 结果
     */
    @Override
    public int updatePublicUserRecord(PublicUserRecord publicUserRecord)
    {
        publicUserRecord.setUpdateTime(DateUtils.getNowDate());
        return publicUserRecordMapper.updatePublicUserRecord(publicUserRecord);
    }

    /**
     * 批量删除公众号用户浏览记录
     *
     * @param ids 需要删除的公众号用户浏览记录主键
     * @return 结果
     */
    @Override
    public int deletePublicUserRecordByIds(String ids)
    {
        return publicUserRecordMapper.deletePublicUserRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除公众号用户浏览记录信息
     *
     * @param id 公众号用户浏览记录主键
     * @return 结果
     */
    @Override
    public int deletePublicUserRecordById(Long id)
    {
        return publicUserRecordMapper.deletePublicUserRecordById(id);
    }
}
