package com.xjrsoft.module.system.service.impl;

import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.system.entity.WechatMessageLog;
import com.xjrsoft.module.system.mapper.WechatMessageLogMapper;
import com.xjrsoft.module.system.service.IWechatMessageLogService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @title: 微信消息发送记录
 * @Author dzx
 * @Date: 2024年6月11日
 * @Version 1.0
*/
@Service
@AllArgsConstructor
public class WechatMessageLogServiceImpl extends MPJBaseServiceImpl<WechatMessageLogMapper, WechatMessageLog> implements IWechatMessageLogService {


    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean add(WechatMessageLog wechatMessageLog) {
        this.baseMapper.insert(wechatMessageLog);
        return true;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean update(WechatMessageLog wechatMessageLog) {
        this.baseMapper.updateById(wechatMessageLog);
        return true;
    }

    @Transactional(rollbackFor = Exception.class)
    public Boolean delete(List<Long> ids) {
        this.baseMapper.deleteBatchIds(ids);
        return true;
    }
}
