package com.tuoheng.admin.service.third.airport;

import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.request.accident.AccidentFlightRequest;
import com.tuoheng.admin.request.accident.ReversalFlightRequest;
import com.tuoheng.admin.vo.AirportInfoVo;
import com.tuoheng.admin.vo.AirportLineVo;
import com.tuoheng.common.core.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AirportServiceImpl implements AirportService {

    @Autowired
    private GetAirportListService getAirportListService;

    @Autowired
    private GetAirportDetailService getAirportDetailService;

    @Autowired
    private GetAirLineListService getAirLineListService;

    @Autowired
    private ExecuteTaskService executeTaskService;

    @Autowired
    private GetDroneDataByIdService getDroneDataByIdService;

    @Autowired
    private PointFlightService pointFlightService;

    @Autowired
    private ReversalFlightService reversalFlightService;

    @Autowired
    private GetAirportListByAirportIds getAirportListByAirportIds;

    @Override
    public List<AirportInfoVo> getAirportInfoList(String airportIds) {
        return getAirportListByAirportIds.getAirportInfo(airportIds);
    }

    @Override
    public List<AirportLineVo> getAirportLineListByAirportIdAndLineIdList(String airportId, List<Integer> airportLineIdList) {
        return getAirLineListService.getList(airportId, airportLineIdList);
    }

    @Override
    public JsonResult getAirportList() {
        return getAirportListService.getAirportList();
    }

    @Override
    public JsonResult getAirportDetail(Integer airportId,String airportCode) {
        return getAirportDetailService.getAirportDetail(airportId,airportCode);
    }

    @Override
    public JsonResult getAirLineListByDroneId(Integer droneId) {
        return getAirLineListService.getAirLineList(droneId);
    }

    @Override
    public JsonResult getAirLineListByAirportId(String airportId) {
        List<AirportLineVo> airportLineVoList = getAirLineListService.getList(airportId, null);
        return JsonResult.success(airportLineVoList);
    }

    @Override
    public JsonResult executeTask(String userId, Inspection inspection) {
        return executeTaskService.executeTask(userId, inspection);
    }

    @Override
    public JsonResult getDroneDataById(Integer airportId) {
        return getDroneDataByIdService.getDroneDataById(airportId);
    }

    @Override
    public JsonResult pointFlight(AccidentFlightRequest request) {
        return pointFlightService.pointFlight(request);
    }

    @Override
    public JsonResult reversalFlight(ReversalFlightRequest request) {
        return reversalFlightService.reversalFlight(request);
    }

}
