package com.xinelu.manage.service.subscribemessagesendrecord.impl;

import com.xinelu.manage.domain.subscribemessagesendrecord.SubscribeMessageSendRecord;
import com.xinelu.manage.mapper.subscribemessagesendrecord.SubscribeMessageSendRecordMapper;
import com.xinelu.manage.service.subscribemessagesendrecord.ISubscribeMessageSendRecordService;
import org.springframework.stereotype.Service;

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

/**
 * 微信小程序订阅消息发送结果记录Service业务层处理
 *
 * @author xinelu
 * @date 2024-03-19
 */
@Service
public class SubscribeMessageSendRecordServiceImpl implements ISubscribeMessageSendRecordService {
    @Resource
    private SubscribeMessageSendRecordMapper subscribeMessageSendRecordMapper;

    /**
     * 查询微信小程序订阅消息发送结果记录
     *
     * @param id 微信小程序订阅消息发送结果记录主键
     * @return 微信小程序订阅消息发送结果记录
     */
    @Override
    public SubscribeMessageSendRecord selectSubscribeMessageSendRecordById(Long id) {
        return subscribeMessageSendRecordMapper.selectSubscribeMessageSendRecordById(id);
    }

    /**
     * 查询微信小程序订阅消息发送结果记录列表
     *
     * @param subscribeMessageSendRecord 微信小程序订阅消息发送结果记录
     * @return 微信小程序订阅消息发送结果记录
     */
    @Override
    public List<SubscribeMessageSendRecord> selectSubscribeMessageSendRecordList(SubscribeMessageSendRecord subscribeMessageSendRecord) {
        return subscribeMessageSendRecordMapper.selectSubscribeMessageSendRecordList(subscribeMessageSendRecord);
    }

    /**
     * 新增微信小程序订阅消息发送结果记录
     *
     * @param subscribeMessageSendRecord 微信小程序订阅消息发送结果记录
     * @return 结果
     */
    @Override
    public int insertSubscribeMessageSendRecord(SubscribeMessageSendRecord subscribeMessageSendRecord) {
        subscribeMessageSendRecord.setCreateTime(LocalDateTime.now());
        return subscribeMessageSendRecordMapper.insertSubscribeMessageSendRecord(subscribeMessageSendRecord);
    }

    /**
     * 修改微信小程序订阅消息发送结果记录
     *
     * @param subscribeMessageSendRecord 微信小程序订阅消息发送结果记录
     * @return 结果
     */
    @Override
    public int updateSubscribeMessageSendRecord(SubscribeMessageSendRecord subscribeMessageSendRecord) {
        subscribeMessageSendRecord.setUpdateTime(LocalDateTime.now());
        return subscribeMessageSendRecordMapper.updateSubscribeMessageSendRecord(subscribeMessageSendRecord);
    }

    /**
     * 批量删除微信小程序订阅消息发送结果记录
     *
     * @param ids 需要删除的微信小程序订阅消息发送结果记录主键
     * @return 结果
     */
    @Override
    public int deleteSubscribeMessageSendRecordByIds(Long[] ids) {
        return subscribeMessageSendRecordMapper.deleteSubscribeMessageSendRecordByIds(ids);
    }

    /**
     * 删除微信小程序订阅消息发送结果记录信息
     *
     * @param id 微信小程序订阅消息发送结果记录主键
     * @return 结果
     */
    @Override
    public int deleteSubscribeMessageSendRecordById(Long id) {
        return subscribeMessageSendRecordMapper.deleteSubscribeMessageSendRecordById(id);
    }
}
