package com.tuoheng.admin.controller;

import com.tuoheng.admin.entity.request.inspection.AirportLineRequest;
import com.tuoheng.admin.service.airportline.IAirportLineService;
import com.tuoheng.common.core.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 航线前端控制器
 *
 * @Author ChengWang
 * @Date 2023/3/2
 */
@RestController
@RequestMapping("/airportLine")
public class AirportLineController {

    @Autowired
    private IAirportLineService airportLineService;

    /**
     * 根据任务id获取航线
     * @param inspectionId
     * @return
     */
    @GetMapping("/info/byInspectionId/{inspectionId}")
    public JsonResult getInfoByInspectionId(@PathVariable("inspectionId") String inspectionId) {
        return airportLineService.getInfoByInspectionId(inspectionId);
    }

    /**
     *添加航线
     * @param request
     * @return
     */
    @PostMapping("/add")
    public JsonResult addAirportLine(@RequestBody AirportLineRequest request){
        return airportLineService.addAirportLine(request);
    }
}
