package com.ruoyi.ibs.task.service.impl;

import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.ibs.task.domain.dto.VisitErrorLogDTO;
import com.ruoyi.ibs.task.domain.entity.VisitErrorLog;
import com.ruoyi.ibs.task.mapper.VisitErrorLogMapper;
import com.ruoyi.ibs.task.service.VisitErrorLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @Author 吴凯程
 * @Date 2025/3/3
 **/
@Service
public class VisitErrorLogServiceImpl implements VisitErrorLogService {

    @Resource
    private VisitErrorLogMapper visitErrorLogMapper;

    /**
     * @param visitErrorLogDTO
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addVisitErrorLog(VisitErrorLogDTO visitErrorLogDTO) {
        VisitErrorLog visitErrorLog = new VisitErrorLog();
        BeanUtils.copyProperties(visitErrorLogDTO, visitErrorLog);
        visitErrorLogMapper.insert(visitErrorLog);
        return "无法触达日志插入成功";
    }
}
