package com.inspect.analysis.service.impl;

import com.inspect.analysis.domain.AnalyseLog;
import com.inspect.analysis.mapper.ResultAnalysisMapper;
import com.inspect.analysis.service.IAnalyseLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class AnalyseLogServiceImpl implements IAnalyseLogService {
    private final Logger log = LoggerFactory.getLogger(getClass());
    @Resource
    private ResultAnalysisMapper resultAnalysisMapper;

    @Override
    @Transactional
    public void log(AnalyseLog analyseLog) {
        try {
            resultAnalysisMapper.insertAnalyseLog(analyseLog);
        } catch (Exception e) {
            log.error("[ANALYSE REMOTE LOG] Exception: {}", e.getMessage());
        }
    }
}
