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.PlayletPublicUserMapper;
import com.playlet.system.domain.PlayletPublicUser;
import com.playlet.system.service.IPlayletPublicUserService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 公众号用户Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-14
 */
@Service
public class PlayletPublicUserServiceImpl extends ServiceImpl<PlayletPublicUserMapper, PlayletPublicUser> implements IPlayletPublicUserService
{
    @Autowired
    private PlayletPublicUserMapper playletPublicUserMapper;

    /**
     * 查询公众号用户
     *
     * @param id 公众号用户主键
     * @return 公众号用户
     */
    @Override
    public PlayletPublicUser selectPlayletPublicUserById(Long id)
    {
        return playletPublicUserMapper.selectPlayletPublicUserById(id);
    }

    /**
     * 查询公众号用户列表
     *
     * @param playletPublicUser 公众号用户
     * @return 公众号用户
     */
    @Override
    public List<PlayletPublicUser> selectPlayletPublicUserList(PlayletPublicUser playletPublicUser)
    {
        return playletPublicUserMapper.selectPlayletPublicUserList(playletPublicUser);
    }

    /**
     * 新增公众号用户
     *
     * @param playletPublicUser 公众号用户
     * @return 结果
     */
    @Override
    public int insertPlayletPublicUser(PlayletPublicUser playletPublicUser)
    {
        playletPublicUser.setCreateTime(DateUtils.getNowDate());
        return playletPublicUserMapper.insertPlayletPublicUser(playletPublicUser);
    }

    /**
     * 修改公众号用户
     *
     * @param playletPublicUser 公众号用户
     * @return 结果
     */
    @Override
    public int updatePlayletPublicUser(PlayletPublicUser playletPublicUser)
    {
        playletPublicUser.setUpdateTime(DateUtils.getNowDate());
        return playletPublicUserMapper.updatePlayletPublicUser(playletPublicUser);
    }

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

    /**
     * 删除公众号用户信息
     *
     * @param id 公众号用户主键
     * @return 结果
     */
    @Override
    public int deletePlayletPublicUserById(Long id)
    {
        return playletPublicUserMapper.deletePlayletPublicUserById(id);
    }
}
