package com.hzya.frame.sysnew.messageManageLogBack.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
import com.hzya.frame.sysnew.messageManageLogBack.dao.ISysMessageManageLogBackDao;
import com.hzya.frame.sysnew.messageManageLogBack.entity.SysMessageManageLogBackEntity;
import com.hzya.frame.sysnew.messageManageLogBack.service.ISysMessageManageLogBackService;
import org.springframework.stereotype.Service;

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

/**
 *
 * @content 消息管理日志备份(SysMessageManageLogBack)表服务实现类
 * @Param
 * @Return
 * @Author hecan
 * @Date 2024/3/6 17:27
 * **/
@Service(value="sysMessageManageLogBackServiceImpl")
public class SysMessageManageLogBackServiceImpl extends BaseService<SysMessageManageLogBackEntity, String> implements ISysMessageManageLogBackService {

    @Resource
    private ISysMessageManageLogBackDao sysMessageManageLogBackDao;
    /**
     * 
     * @content 备份ESB消息日志
     * @Param 
     * @Return 
     * @Author hecan 
     * @Date 2024/3/7 9:35
     * **/
    @Override
    public Integer saveSysMessageManageLogBack(List<SysMessageManageLogEntity> list) {
            logger.info("需要备份的ESB消息日志有{}条",list.size());
            if(CollUtil.isEmpty(list)){
                return null;
            }else{
                logger.info("==========开始备份的ESB消息日志==========");
                Integer integer = sysMessageManageLogBackDao.entityInsertBatch(list);
                logger.info("==========备份的ESB消息日志结束==========");
                return integer;
            }
    }
}
