package com.dxhy.core.service.log.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.core.dao.SysLogDao;
import com.dxhy.core.entity.SysLogEntity;
import com.dxhy.core.service.log.SysLogService;

/**
 * @author user
 */
@Service("sysLogService")
public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLogEntity> implements SysLogService {

    @Override
    public void saveLog(List<SysLogEntity> logs) {
        DynamicContextHolder.push(DbConstant.BASICS_WRITE);
        this.insertLog(logs);
    }

    public void insertLog(List<SysLogEntity> logs) {
        this.saveBatch(logs);
    }
}
