package com.yushu.system.service.impl;

import com.yushu.common.utils.DateUtils;
import com.yushu.system.domain.SysMailLog;
import com.yushu.system.mapper.SysMailLogMapper;
import com.yushu.system.service.ISysMailLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 邮件发送记录Service业务层处理
 * 
 * @author yushu
 * @date 2024-12-13
 */
@Service
public class SysMailLogServiceImpl implements ISysMailLogService {

    @Autowired
    private SysMailLogMapper sysMailLogMapper;

    @Override
    public SysMailLog selectSysMailLogByLogId(Long logId) {
        return sysMailLogMapper.selectSysMailLogByLogId(logId);
    }

    @Override
    public List<SysMailLog> selectSysMailLogList(SysMailLog sysMailLog) {
        return sysMailLogMapper.selectSysMailLogList(sysMailLog);
    }

    @Override
    public int insertSysMailLog(SysMailLog sysMailLog) {
        sysMailLog.setCreateTime(DateUtils.getNowDate());
        return sysMailLogMapper.insertSysMailLog(sysMailLog);
    }

    @Override
    public int updateSysMailLog(SysMailLog sysMailLog) {
        return sysMailLogMapper.updateSysMailLog(sysMailLog);
    }

    @Override
    public int deleteSysMailLogByLogIds(Long[] logIds) {
        return sysMailLogMapper.deleteSysMailLogByLogIds(logIds);
    }

    @Override
    public int deleteSysMailLogByLogId(Long logId) {
        return sysMailLogMapper.deleteSysMailLogByLogId(logId);
    }

    @Override
    public void cleanMailLog() {
        sysMailLogMapper.cleanMailLog();
    }
}
