package cn.sikey.tools.service.firmware;

import cn.sikey.tools.controller.app.firmware.vo.FirmwareUpgradeRespVO;
import cn.sikey.tools.controller.app.firmware.vo.QueryFirmwareUpgradeReqVO;
import cn.sikey.tools.convert.FirmwareConvert;
import cn.sikey.tools.dal.dataobject.FirmwareUpgradeDO;
import cn.sikey.tools.dal.mysql.FirmwareMapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: nelson
 * @Date: 2025/6/6
 * @Description: 固件
 */
@Service
@Slf4j
public class FirmwareServiceImpl implements FirmwareService {

    @Resource
    private FirmwareMapper firmwareMapper;

    /**
     * 固件升级
     *
     * @param reqVO 固件升级
     * @return
     */
    @Override
    public List<FirmwareUpgradeRespVO> queryFirmwareUpgrade(QueryFirmwareUpgradeReqVO reqVO) {
        List<FirmwareUpgradeDO> firmwareUpgradeDO = firmwareMapper.queryFirmwareUpgrade(reqVO);
        return FirmwareConvert.INSTANCE.convertFirmwareUpgradeRespVO(firmwareUpgradeDO);
    }
}
