package com.corewing.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.corewing.app.dto.publicFirmware.PublicBoardTypeListRequest;
import com.corewing.app.dto.publicFirmware.PublicFirmwareListRequest;
import com.corewing.app.dto.publicFirmware.PublicFirmwareVersionListRequest;
import com.corewing.app.entity.AppPublicFirmwarePlane;
import com.corewing.app.entity.AppPublicFirmwareVersion;
import com.corewing.app.mapper.AppPublicFirmwareVersionMapper;
import com.corewing.app.service.AppPublicFirmwareVersionService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppPublicFirmwareVersionServiceImpl extends ServiceImpl<AppPublicFirmwareVersionMapper, AppPublicFirmwareVersion> implements AppPublicFirmwareVersionService {

    @Override
    public List<AppPublicFirmwareVersion> getVersionList(PublicFirmwareVersionListRequest publicFirmwareVersionListRequest) {
        LambdaQueryWrapper<AppPublicFirmwareVersion> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(AppPublicFirmwareVersion::getType, publicFirmwareVersionListRequest.getFirmwareType());
        wrapper.orderByAsc(AppPublicFirmwareVersion::getSortCode);
        return list(wrapper);
    }

}
