package com.cico.nest.lcdp.boot.core.system.api.errorcode;

import com.cico.nest.lcdp.boot.core.system.service.errorcode.ErrorCodeService;
import com.cico.nest.lcdp.boot.api.system.errorcode.ErrorCodeApi;
import com.cico.nest.lcdp.boot.api.system.errorcode.dto.ErrorCodeAutoGenerateReqDTO;
import com.cico.nest.lcdp.boot.api.system.errorcode.dto.ErrorCodeRespDTO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 错误码 Api 实现类
 *
 * @author zws
 */
@Service
public class ErrorCodeApiImpl implements ErrorCodeApi {

    @Resource
    private ErrorCodeService errorCodeService;

    @Override
    public void autoGenerateErrorCodeList(List<ErrorCodeAutoGenerateReqDTO> autoGenerateDTOs) {
        errorCodeService.autoGenerateErrorCodes(autoGenerateDTOs);
    }

    @Override
    public List<ErrorCodeRespDTO> getErrorCodeList(String applicationName, LocalDateTime minUpdateTime) {
        return errorCodeService.getErrorCodeList(applicationName, minUpdateTime);
    }

}
