package kr.xit.core.biz.service;

import java.util.List;
import kr.xit.core.biz.mapper.ILoggingMapper;
import kr.xit.core.biz.model.LoggingDTO;
import kr.xit.core.service.AbstractService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * <pre>
 * description :
 *
 * packageName : kr.xit.core.biz.service
 * fileName    : LoggingServiceImpl
 * author      : limju
 * date        : 2023-05-11
 * ======================================================================
 * 변경일         변경자        변경 내용
 * ----------------------------------------------------------------------
 * 2023-05-11    limju       최초 생성
 *
 * </pre>
 */

@Slf4j
@Service
public class LoggingService extends AbstractService implements ILoggingService{
    private final ILoggingMapper mapper;

    public LoggingService(ILoggingMapper mapper) {
        this.mapper = mapper;
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @Override
    public void saveLogging(final LoggingDTO reqDTO){
        mapper.saveLogging(reqDTO);
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @Override
    public void modifyLogging(final LoggingDTO reqDTO){
        mapper.updateLogging(reqDTO);
    }

    @Override
    public List<LoggingDTO> findLogging(final LoggingDTO reqDTO) {
        return mapper.selectLogging(reqDTO);
    }

    @Override
    public LoggingDTO findLogging() {
        return mapper.selectLogging();
    }
}
