package com.tuoheng.miniprogram.controller;

import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.miniprogram.service.AirportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ChengWang
 * @Date 2022/11/30
 */
@Slf4j
@RestController
@RequestMapping("/airport")
public class AirPortController {

    @Autowired
    private AirportService airportService;

    /**
     * 获取巡检机场
     */
    @GetMapping("/list")
    public JsonResult getList() {
        return airportService.getAirportList();
    }

    /**
     * 获取巡检线路
     *
     * @param droneId 机场列表里面的droneId
     * @return
     */
    @GetMapping("/line/list/{droneId}")
    public JsonResult getAirLineList(@PathVariable("droneId") Integer droneId) {
        return airportService.getAirLineList(droneId);
    }





}
