package com.hzya.frame.sysnew.messageManageLogBack.detail.server.impl;

import cn.hutool.core.collection.CollUtil;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.sysnew.messageManageLogDetail.entity.SysMessageManageLogDetailEntity;
import com.hzya.frame.sysnew.messageManageLogBack.detail.dao.ISysMessageManageLogDetailBackDao;
import com.hzya.frame.sysnew.messageManageLogBack.detail.entity.SysMessageManageLogDetailBackEntity;
import com.hzya.frame.sysnew.messageManageLogBack.detail.server.ISysMessageManageLogDetailBackService;
import org.springframework.stereotype.Service;

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

/**
 *
 * @content 消息管理日志明细备份(SysMessageManageLogDetailBack)表服务实现类
 * @Param
 * @Return
 * @Author hecan
 * @Date 2024/3/6 17:28
 * **/
@Service(value="sysMessageManageLogDetailBackServiceImpl")
public class SysMessageManageLogDetailBackServiceImpl extends BaseService<SysMessageManageLogDetailBackEntity, String> implements ISysMessageManageLogDetailBackService {
    @Resource
    private ISysMessageManageLogDetailBackDao sysMessageManageLogDetailBackDao;
    @Override
    public Integer saveSysMessageManageLogDetail(List<SysMessageManageLogDetailEntity> list) {
        logger.info("需要备份的ESB消息日志明细有{}条",list.size());
            if(CollUtil.isEmpty(list)){
                return null;
            }else {
                logger.info("==========开始备份的ESB消息日志明细==========");
                Integer integer = sysMessageManageLogDetailBackDao.entityInsertBatch(list);
                logger.info("==========备份的ESB消息日志明细结束==========");
                return integer;
            }
    }
}
