package com.tuoheng.miniprogram.controller;

import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.miniprogram.entity.query.InspectionQuery;
import com.tuoheng.miniprogram.service.IInspectionService;
import com.tuoheng.miniprogram.vo.AirLineVO;
import com.tuoheng.miniprogram.vo.AirPortVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 巡检任务管理 前端控制器
 *
 * @Author ChengWang
 * @Date 2022/11/21
 */
@Slf4j
@RestController
@RequestMapping("/inspection")
public class InspectionController {


    @Autowired
    private IInspectionService iInspectionService;

    /**
     * 任务列表
     * @param query
     * @return
     */
    @GetMapping("/index")
    public JsonResult index(InspectionQuery query){
        return iInspectionService.index(query);
    }


    /**
     * 回放
     * @param id
     * @return
     */
    @GetMapping("/playback/{id}")
    public JsonResult playback(@PathVariable("id") String id){
        return iInspectionService.playback(id);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("/delete/{id}")
    public JsonResult deleteById(@PathVariable("id") String id){
        return iInspectionService.deleteById(id);
    }


}
