package com.tuoheng.admin.service.airport;

import com.tuoheng.admin.entity.request.airport.DroneControlRequest;
import com.tuoheng.admin.entity.request.airport.PointFlightRequest;
import com.tuoheng.admin.service.airport.drone.QueryDroneDataService;
import com.tuoheng.admin.service.third.airport.DroneControlService;
import com.tuoheng.admin.service.third.airport.PointFlightService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AirportServiceImpl implements AirportService {

    @Autowired
    private QueryDroneDataService queryDroneDataService;

    @Autowired
    private PointFlightService pointFlightService;

    @Autowired
    private DroneControlService droneControlService;

    /**
     * 获取机场列表
     *
     * @return
     */
    @Override
    public JsonResult getList() {
        return JsonResult.success();
    }

    /**
     * 无人机信息
     * @param airportId
     * @return
     */
    @Override
    public JsonResult getDroneDataById(String airportId) {
        return queryDroneDataService.getDroneDataById(airportId);
    }

    /**
     * 定点飞行
     * @param request
     * @return
     */
    @Override
    public JsonResult pointFlight(PointFlightRequest request) {
        return pointFlightService.executePointFligh(request);
    }

    /**
     * 操制无人机
     * @param request
     * @return
     */
    @Override
    public JsonResult droneControl(DroneControlRequest request) {
        return droneControlService.execute(request);
    }
}
